Re: ORA 1003 - No Statement Parsed error

From: Kirk Bradley <kbradley_at_us.oracle.com>
Date: 1996/01/29
Message-ID: <kbradley-2901961807170001_at_kbradley-mac.us.oracle.com>#1/1


you've got the error checking (WHENEVER) after the OPEN.. move it up and see if the OPEN failed.

In article <4d1h3c$1s1_at_leto.pcc.edu>, Howard Thompson <hthompso_at_pcc.edu> wrote:

> I'm having a bummer. I've got a Pro*C program that is producing an
> ORA-1003 error (no statement parsed) and I cannot figure out why.
>
> Pro*C Version: 1.6.4.2.0
> Oracle Version: 7.1.3.0.0
> SQL Version: 3.1.3.4.1
> PL/SQL Version: 2.1.3.0.0
>
> Operating System: Unix: HP-UX 9000
>
> Here is a representative code fragment
>
> EXEC SQL BEGIN DECLARE SECTION;
> VARCHAR V_MainSlctStmt[2048],
> V_RowId[32];
> V_Id[10],
> V_LastName[31],
> V_FirstName[31];
> EXEC SQL END DECLARE SECTION;
>
> main(argc, argv)
> int argc;
> char **argv;
> {
> vf_LogonOracle (argc, argv);
>
> V_MainSlctStmt.len = sprintf(V_MainSlctStmt.arr,
> "SELECT ROWIDTOCHAR(XDEG.ROWID),\
> IDEN_ID,\
> IDEN_LAST_NAME,\
> IDEN_FIRST_NAME\
> FROM IDEN,\
> DEGR XDEG\
> WHERE DEGR_LOAD_IND = 'L'\
> AND IDEN_PIDM = DEGR_PIDM");
>
> EXEC SQL PREPARE MainSlctS FROM :V_MainSlctStmt;
> EXEC SQL DECLARE MainSlctC CURSOR FOR MainSlctS;
> EXEC SQL OPEN MainSlctC;
>
> EXEC SQL WHENEVER NOTFOUND DO break;
> EXEC SQL WHENEVER SQLERROR DO vf_SqlError();
>
> while (TRUE)
> {
> vf_ClearVars(); /* Null fill all select vars */
>
> EXEC SQL FETCH MainSlctC INTO
> :V_RowId,
> :V_Id,
> :V_LastName,
> :V_FirstName;
>
> NullTerminate (V_RowId); /* Function null terms vars */
> NullTerminate (V_Id);
> NullTerminate (V_LastName);
> NullTerminate (V_FirstName);
>
> vf_DoSomeStuff();
> }
> }
>
> The program blows up on the fetch with the ORA 1003 error saying there
> is no statement parsed, yet the variable oraca.orastxt.orastxtc
> contains the very statement I'm trying to process. I've done this type
> of programming a dozen times in the past but I am plain stumped here.
>
> The problem may be related to size. I can shrink the statement, maybe
> change tables and it will go away then it reoccurs when I make the
> select statement longer - and still reoccurs when I shorten it. I
> can't find where/when/if length becomes a problem.
>
> My only guess is that something in vf_ClearVars() is clobbering the
> MainSlctS between the prepare/open and the fetch. Could there be any
> other related problems?
>
> So, my friends, I turn to you.
> --
> * howardt_at_teleport.com | "What we need is a bit less of the 'Well
 really, *
> * Stay Beautiful | sir' and a bit more of the buckling to spirit. *
> * hthompso_at_pcc.edu | Think feudally, Jeeves!" Bertie Wooster *
Received on Mon Jan 29 1996 - 00:00:00 CET

Original text of this message