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

Home -> Community -> Usenet -> c.d.o.misc -> OCI and binding arrays

OCI and binding arrays

From: Nicolay Aslaksen <nas_at_ementor.no>
Date: 22 Nov 2002 10:33:40 GMT
Message-ID: <Xns92CE765F52A32nasementorno@195.58.103.121>


I am coding a C++ application on a windows 2000 platform (it will later be running on Linux and AIX).

I would like to execute a select statement where the WHERE-part is an array
(of id's):

something like this in C++:



long buffSize = 4;
long *IDlist = new long[buffSize];
IDlist[0] = 982374;
IDlist[1] = 324443;
IDlist[2] = 989485;
IDlist[3] = 430904;

sql = "SELECT ref(x) FROM persons p WHERE p.id IN :id";

Prepare (sql);
OCIBindByPos(stmtp, bindp, errhp, 1, (dvoid*)&IDList, buffSize,
(ub2)SQLT_INT, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0,
(ub4)OCI_DEFAULT);


I have seen several questions about similar problems/whishes, but I have not found any answers to the problem.
Is there anyone who has a solution to this problem?

Any help is appreciated.

Nicolay Aslaksen
Ementor Norway ASA Received on Fri Nov 22 2002 - 04:33:40 CST

Original text of this message

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