Home » Developer & Programmer » Precompilers, OCI & OCCI » SELECT, IN bind, OUT bind
SELECT, IN bind, OUT bind [message #260890] Tue, 21 August 2007 03:42
kurosava
Messages: 1
Registered: August 2007
Junior Member
Hello,

my code example looks like this:

...

sqlStmt = string("SELECT id INTO ") + ":x" + " FROM table WHERE id=:1";
stmt->setSQL(sqlStmt);
try
{
stmt->setDataBuffer(1,index,OCCINT,sizeof(index[0]),indexLen);
ResultSet *rs=stmt->executeQuery();
rs->setDataBuffer(1,indexQue,OCCINT,sizeof(indexQue[0]),indexQueLen);
rs->next(nRows);
i = stmt->getUpdateCount();
}

...

Table has 10 rows, "index" has 10 elements (from 0 to 9), "id" goes from 0 to 9. When I execute this, I expect that all 10 rows are selected, but only first row is selected, for id=0.

When I use in WHERE clause instead of IN bind for example "A>20 and B<40" (A and B are columns in table) than I get more than one selected row (i>1).

Does anyone knows what is the problem?

P.S. I am using OCCI 9.2.
Previous Topic: Language C in oracle
Next Topic: Proc on Windows 2000
Goto Forum:
  


Current Time: Thu Mar 28 10:21:29 CDT 2024