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 -> Pro C Cursor problem

Pro C Cursor problem

From: <timothy.tang_at_csfb.com>
Date: Wed, 08 Apr 1998 06:06:33 -0600
Message-ID: <6gflno$inl$1@nnrp1.dejanews.com>


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);
}
end_select_loop:

    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:06:33 CDT

Original text of this message

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