开发者

SQLException in JDBC

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?


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜