Advertisement

05.30.2008 at 12:45PM PDT, ID: 23445820
[x]
Attachment Details

SQLExecute fails with Invalid Cursor State...

Asked by bganoush in DB2 Database

Tags:

HI,

I am trying to "reuse" a prepared statement but when I call SQLExecute, it fails on the second call.

For instance, I do this:

rc = SQLPrepare (h);
rc = SQLBindParameter (..... idstr...);
while (loop_while_changing_parameter)
{
strcpy (idstr, GetNextIDString());
rc = SQLExecute ( .... );
// rc returns -1 here but not the first time in the loop
while (rc == SQL_SUCCESS)
    SQLFetch(....);
}

Start Free Trial
[+][-]05.30.2008 at 10:15PM PDT, ID: 21682789

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.02.2008 at 02:36AM PDT, ID: 21690611

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: DB2 Database
Tags: IBM UDB CLI DB2
Sign Up Now!
Solution Provided By: TomasHelgi
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628