0

I am using the camel sql(version 2.20.1) and running an sql query using the template

SELECT column1,column2 FROM my_table WHERE column2 IN (:#in:ids).

Everything here is working fine, but my doubt is like how does it handle the case: if the count of ids greater than 1000.

Does camel handle this case internally or should I create sublist of size 1000 in this case?

Since I am new to this camel implementation looking for a more optimized solution if there is any.

Girish007
  • 442
  • 6
  • 26
  • 1
    If the syntax you show is modified so that there are 1000 ID values in the list for the `IN` clause, Informix should be fine with it. If you are using an old enough version of Informix (one that's now out of support), you might run into limitations on number of items in the list, but in the latest version (12.10), we've been messing with large lists — tens of thousands of items. It isn't a good idea to use such large lists, but it should work. – Jonathan Leffler Apr 15 '18 at 21:27
  • This is not a limitation of Apache Camel, this is a limitation of the database driver. – Alexey Yakunin Apr 16 '18 at 07:56
  • 1
    Camel has no limitation in the IN clause, if you have 1, 500, or 50000 elements then it uses that. But as Jonathan says, its a very BAD to use a huge IN clause. – Claus Ibsen Apr 16 '18 at 08:17
  • yes I got the point. But what is the alternative for this to make it better? Should I query the values one by one using `id=value` in a loop or reduce the count if params in `IN` clause? – Girish007 Apr 16 '18 at 16:00
  • @Girish007 I have similar scenario where I need to pass collection of values to IN clause. With respect to the query in the above question how are you passing the values for (:#in:ids) – Ronald James May 04 '18 at 10:35

0 Answers0