Declare Cursor error while implementing SCROLL CURSOR

I

invy

Hi,
I'm experiencing a problem while declaring scroll cursor. I'm
using Embeded SQL with C. my code is given below.

#ifdef SQLSRVR_RDBMS
EXEC SQL DECLARE CUR_DWNLD SCROLL CURSOR FOR SCURS;
EXEC SQL PREPARE SCURS FROM :S_QRY;
#endif


When i compile with nsqlprep, The error I'm getting is as below.


EXEC SQL DECLARE REGCDWNLD_CUR_CUST_DWNLD CURSOR SCROLL
SQLPREP: SQL Compile Error at line 709
OPEN REGCDWNLD_CUR_CUST_DWNLD
Error code: -19946

Cursor REGCDWNLD_CUR_CUST_DWNLD not declared
SQLPREP: SQL Compile Error at line 787
FETCH REGCDWNLD_CUR_CUST_DWNLD INTO : , : , :
, : , : ,
Error code: -19946

The code works without SCROLL option Is there any
problem with my declaration? If yes how can i correct this. I'm using
MSSQLSERVER 2000 and WINDOW 2000. Pre-compiler is NSQLPREP. Please
reply ASAP.
 
W

What's in a namespace

invy said:
Hi,
I'm experiencing a problem while declaring scroll cursor. I'm
using Embeded SQL with C. my code is given below.

#ifdef SQLSRVR_RDBMS
EXEC SQL DECLARE CUR_DWNLD SCROLL CURSOR FOR SCURS;
EXEC SQL PREPARE SCURS FROM :S_QRY;
#endif


When i compile with nsqlprep, The error I'm getting is as below.


EXEC SQL DECLARE REGCDWNLD_CUR_CUST_DWNLD CURSOR SCROLL
SQLPREP: SQL Compile Error at line 709
OPEN REGCDWNLD_CUR_CUST_DWNLD
Error code: -19946

Cursor REGCDWNLD_CUR_CUST_DWNLD not declared
SQLPREP: SQL Compile Error at line 787
FETCH REGCDWNLD_CUR_CUST_DWNLD INTO : , : , :
, : , : ,
Error code: -19946

The code works without SCROLL option Is there any
problem with my declaration? If yes how can i correct this. I'm using
MSSQLSERVER 2000 and WINDOW 2000. Pre-compiler is NSQLPREP. Please
reply ASAP.

Stop cross posting please. You're in the wrong group here.
 
C

CBFalconer

invy said:
I'm experiencing a problem while declaring scroll cursor. I'm
using Embeded SQL with C. my code is given below.

#ifdef SQLSRVR_RDBMS
EXEC SQL DECLARE CUR_DWNLD SCROLL CURSOR FOR SCURS;
EXEC SQL PREPARE SCURS FROM :S_QRY;
#endif

Nothing to do with the standard C language. F'ups set.
 
J

John Bell

Hi

Is #ifdef SQLSRVR_RDBMS defined correctly? Error 19946 says that the cursor
is not declared.

John
 
C

CBFalconer

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top