in reply to SQL queries using dynamic array

As 1st reply pointed out, IN is the way to go, just remember that a SQL statement can contain at most 4000 chars. So you need some logic there to control the length, and break into multiple statements if needed.

Replies are listed 'Best First'.
Re^2: SQL queries using dynamic array
by runrig (Abbot) on Aug 04, 2005 at 03:11 UTC
    just remember that a SQL statement can contain at most 4000 chars.

    Which database has that limitation?

    I've googled a bit, and I think that you have that statement mixed up with '(some char column type(s)) can be at most 4000 characters', which would mean that each bind variable could be at most that length.

      The limitation for Microsoft SQL 2000 is 4000 characters. that's unicode, and we are talking about 8000 octets.

      I could not remember the exact length limitation for Oracle, but my pression is that it is 3000+ characters. (The Oracle I use is a bit old, version 8.1.7)

        I guess I've been spoilt by Informix for too long (limit 32K). I did find some info on Oracle, which indicates the limit may be more than 3K, even for 8.x, though there could be some limit of the tools used to access the database.