Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Another ProC mystery...

Another ProC mystery...

From: Steve Blomeley <steveblomeley_at_yahoo.co.uk>
Date: 2000/06/25
Message-ID: <395623F4.27D0532C@yahoo.co.uk>#1/1

Hi,

I had a program that worked OK... something like:

    EXEC SQL FETCH my_cursor INTO :bindvar;     while( 0 == sqlca.sqlcode ) {

       if( bindvar == what_I_am_looking_for )
           INSERT INTO a_table VALUES( :bindvar );
       EXEC SQL FETCH my_cursor INTO :bindvar;

}

This worked fine ... I decided to move the INSERT operation into a seperat function:

    EXEC SQL FETCH my_cursor INTO :bindvar;     while( 0 == sqlca.sqlcode ) {

       my_insert_function( bindvar );
       EXEC SQL FETCH my_cursor INTO :bindvar;

}

This worked fine too ... so I decided to move the definition of the "insert"
function into a seperate source file. Now this links OK, but when I run the
program I get an error on the INSERT statement:

Oracle error: -1036
Message: ORA-01036: illegal variable name/number

This suggests a problem with the bind variable in the INSERT statement, so I changed
this statement to just insert a constant string (ie: 'sometext'), but now things are
weirder still - Every time the INSERT statement is reached, it seems the SELECT cursor
is reset, so the thing just loops forever, fetching the first few rows from the cursor,
attempting 1 insert, then back to fetching the first few rows ... and so on.

Hmmm,
Any ideas?

Thanks
SB Received on Sun Jun 25 2000 - 00:00:00 CDT

Original text of this message

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