Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Pro C Cursor problem
I have experienced some problem when I tried to call the cursor for the second
time within Pro C. The 'WHERE' condition in the select statement may or may
not be changed depending on the results from the previous query.
char * sqlStatement;
while(1)
{
GetNewSqlStatement(sqlStatement); // being malloced within the routine
EXEC SQL PREPARE S FROM :sqlStatement;
EXEC SQL DECLARE C CURSOR FOR S;
EXEC SQL OPEN C;
EXEC SQL DESCRIBE SELECT LIST FOR S INTO selectDp;
DoSomething(selectDp); // local procedure
EXEC SQL WHENEVER SQLERROR GOTO errsql; EXEC SQL WHENEVER NOT FOUND GOTO end_select_loop;
for(;;)
{
EXEC SQL FETCH C USING DESCRIPTOR selectDp; EvaluateResult(selectDp); // local procedure}
EXEC SQL CLOSE C;
sleep(60);
return 1; //Success
errsql:
return 0; //Failed
Can any one help?
Timothy Tang
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Wed Apr 08 1998 - 07:08:10 CDT
![]() |
![]() |