Subject Re: SQL query aborts when SQL statement is too long or complex.
Author Dmitry Yemanov
10.02.2014 08:55, hosodaamiya wrote:
>> What do you mean by available range? Documented 1500 items limit or
>> something else?
> I meant documented 1500 items limit.
> I create the WHERE clause with less than 1000 constants.
> But 1000 or less constants makes the query execution unsuccessful.
> My script cannot handle the error.
> The error in windows event log that I have meant before is recorded instead.

The 1500 items limit is not abstract. The IN list is transformed into a
set of ORs and then processed recursively, thus requiering a large
enough stack. Every thread has a limited stack size. On Windows, the
default value is 1MB and it's predefined for exe-files at their linkage
time. This is not enough for Firebird, so both fbserver.exe and
fb_inet_server.exe override the limit to be 2MB on 32-bit platforms and
4MB on 64-bit ones. However, the embedded server is a library, so it
depends on the stack size of the application that loads fbembed.dll. In
your case this should be IIS and you surely cannot recompile it, but
there are some tricks that you could try, see for example:

Another option is to use a standalone Firebird server instead of the
embedded one.