| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: How to use an array in the IN clause?
Daniel Kunz wrote:
> I'm using Oracle 9.2 and I would like to use an array/collection in
> the IN clause of a SELECT statement. My application is programmed in C
> and I'm using OCI. The select statement I'm using looks like this:
> "SELECT value FROM numbertab WHERE zvalue IN :1"
> The number table is rather huge (it contains several millions of
> rows). The ':1' parameter corresponds to a set containing about 300
> numbers (the numbers of this input set are calculated in realtime).
> Because issuing 300 select statements separately would cost lots of
> performance, I came up with the idea of using an array/collection as
> input for the select statement.
> Unfortunately, I couldn't find any OCI documentation how to do it. Is
> it possible at all? I guess that OCIBindArrayOfStruct() cannot be
> used, because it doesn't allow to specify the size of the array.
>
> I am totally stumped - any ideas out there??
>
> Thanks very much for any responses.
>
> - Danny.
> Is it possible at all?
Not as far as I know; at least how you want to do it. You could create the necessary actual SQL SELECT statement and the EXECUTE IMMEDIATE this statement. Received on Fri Mar 19 2004 - 19:58:28 CST
![]() |
![]() |