Declare Cursor error while implementing SCROLL CURSOR

Discussion in 'C Programming' started by invy, Dec 28, 2006.

  1. invy

    invy Guest

    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.
    invy, Dec 28, 2006
    #1
    1. Advertising

  2. "invy" <> schreef in bericht
    news:...
    > 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.
    What's in a namespace, Dec 28, 2006
    #2
    1. Advertising

  3. invy

    CBFalconer Guest

    invy wrote:
    >
    > 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.

    --
    Chuck F (cbfalconer at maineline dot net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net>
    CBFalconer, Dec 28, 2006
    #3
  4. invy

    John Bell Guest

    Hi

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

    John


    "invy" <> wrote in message
    news:...
    > 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.
    >
    John Bell, Dec 28, 2006
    #4
  5. invy

    CBFalconer Guest

    John Bell wrote:
    >
    > Is #ifdef SQLSRVR_RDBMS defined correctly? Error 19946 says that
    > the cursor is not declared.


    Please don't top-post. See the following links. And also please
    do not post off-topic material to comp.lang.c. F'ups set.

    --
    Some informative links:
    <http://www.geocities.com/nnqweb/>
    <http://www.catb.org/~esr/faqs/smart-questions.html>
    <http://www.caliburn.nl/topposting.html>
    <http://www.netmeister.org/news/learn2quote.html>
    <http://cfaj.freeshell.org/google/>
    CBFalconer, Dec 28, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nicholas
    Replies:
    0
    Views:
    427
    nicholas
    Dec 7, 2004
  2. Kevin
    Replies:
    1
    Views:
    9,497
    Roland
    Feb 5, 2005
  3. Oliver Wong
    Replies:
    16
    Views:
    596
    Oliver Wong
    Jun 28, 2006
  4. Dani Valverde

    Declare self.cursor

    Dani Valverde, Aug 24, 2010, in forum: Python
    Replies:
    2
    Views:
    347
    John Nagle
    Aug 25, 2010
  5. dmaziuk
    Replies:
    3
    Views:
    549
    Chris Gonnerman
    Jan 25, 2011
Loading...

Share This Page