Home » Developer & Programmer » Precompilers, OCI & OCCI » setMaxIterations API of OCCI not setting the max number of iterations
setMaxIterations API of OCCI not setting the max number of iterations [message #139405] Tue, 27 September 2005 20:18 Go to next message
navinn.sharma1@gmail.com
Messages: 1
Registered: September 2005
Junior Member
Hi

Am using oracle 9.2.0.1.0 version.
trying to use OCCI's bulk insertion feature using AP setMaxIteration, addIterations and executeUpdate combinations.

from code (OCCI) if i do stmt->setMaxIterations(60)

and then check for number of max iterations set by setMaxIterations using getMaxIterations it returns me 1(default value).

Did setMaxParamSize as well.
Also, moving ahead if I bind params of the statement and on reaching addIteration API, it throws an SQLException -: "ORA-32142: maximum number of iterations exceeded"

Hope this was not a bug in this version of Oracle, if so request you to let me know in which version it got fixed and the patch location.

Also, if anyone has this version, pl write down few lines of code and verify in the same oracle version, so that I can figure out whether this is a problem in my code or oracle supplied OCCI 9 libraries.

Thanking you in anticipation.

Regards
Navin Sharma

Code snippet:

conn = env->createConnection("scott", "tiger","");
stmt = conn->createStatement("INSERT INTO table_name VALUES(:1,:2)");
stmt->setMaxIterations(62);
cout<<"Number of iterations set by setMaxIterations - "<<stmt->getMaxIterations();

stmt->setInt(1,100);
stmt->setString(2,"Hello OCCI");
stmt->addIteration();
stmt->setInt(1,400);
stmt->setInt(2,"Am using bulk updates");
stmt->executeUpdate();
Re: setMaxIterations API of OCCI not setting the max number of iterations [message #150013 is a reply to message #139405] Tue, 06 December 2005 00:34 Go to previous message
kmohan
Messages: 28
Registered: July 2005
Junior Member
This worked for me in 9.2.0.5:

conn = env->createConnection("scott", "tiger","");
stmt = conn->createStatement("INSERT INTO table_name VALUES(:1,:2)");
stmt->setMaxIterations(62);
stmt->setMaxParamSize(2,50);
cout<<"Number of iterations set by setMaxIterations - "<<stmt->getMaxIterations(
);

stmt->setInt(1,100);
stmt->setString(2,"Hello OCCI");
stmt->addIteration();
stmt->setInt(1,400);
stmt->setString(2,"Am using bulk updates"); //You used setInt() here which is wrong.
stmt->executeUpdate();
Previous Topic: OCCI Connection Pool on Oracle RAC
Next Topic: Number of rows fetched
Goto Forum:
  


Current Time: Sat Oct 31 15:11:03 CDT 2020