views:

36

answers:

1

Hi,

I am getting a SQLException when I try to run the query in Informix DB using JDBC. The query is huge in size:

select * table_name where tableid in (....)

I get an exception because the 'in' part contain more than 5000 values and because of the length. Is there a way to avoid this or should I break it down and run two queries?

+2  A: 

Create another table with the >5000 tableids.

Then all that's left is an inner-join:

select t.* 
  from table_name t 
       inner join table_tableid tid
       on tid.tableid = t.tableid
Adam Bernier