Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> How to use an array in the IN clause?

How to use an array in the IN clause?

From: Daniel Kunz <dkunz_at_europe.com>
Date: 19 Mar 2004 01:33:27 -0800
Message-ID: <614e041b.0403190133.6996da81@posting.google.com>

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.

Received on Fri Mar 19 2004 - 03:33:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US