Declare Cursor error while implementing SCROLL CURSOR

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • invy

    Declare Cursor error while implementing SCROLL CURSOR

    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_C UST_DWNLD CURSOR SCROLL
    SQLPREP: SQL Compile Error at line 709
    OPEN REGCDWNLD_CUR_C UST_DWNLD
    Error code: -19946

    Cursor REGCDWNLD_CUR_C UST_DWNLD not declared
    SQLPREP: SQL Compile Error at line 787
    FETCH REGCDWNLD_CUR_C UST_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.

  • What's in a namespace

    #2
    Re: Declare Cursor error while implementing SCROLL CURSOR


    "invy" <umeshcg@gmail. comschreef in bericht
    news:1167295554 .978554.157120@ n51g2000cwc.goo glegroups.com.. .
    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_C UST_DWNLD CURSOR SCROLL
    SQLPREP: SQL Compile Error at line 709
    OPEN REGCDWNLD_CUR_C UST_DWNLD
    Error code: -19946
    >
    Cursor REGCDWNLD_CUR_C UST_DWNLD not declared
    SQLPREP: SQL Compile Error at line 787
    FETCH REGCDWNLD_CUR_C UST_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.


    Comment

    • CBFalconer

      #3
      Re: Declare Cursor error while implementing SCROLL CURSOR

      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>

      Comment

      • John Bell

        #4
        Re: Declare Cursor error while implementing SCROLL CURSOR

        Hi

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

        John


        "invy" <umeshcg@gmail. comwrote in message
        news:1167295554 .978554.157120@ n51g2000cwc.goo glegroups.com.. .
        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_C UST_DWNLD CURSOR SCROLL
        SQLPREP: SQL Compile Error at line 709
        OPEN REGCDWNLD_CUR_C UST_DWNLD
        Error code: -19946
        >
        Cursor REGCDWNLD_CUR_C UST_DWNLD not declared
        SQLPREP: SQL Compile Error at line 787
        FETCH REGCDWNLD_CUR_C UST_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.
        >

        Comment

        • CBFalconer

          #5
          Re: Declare Cursor error while implementing SCROLL CURSOR

          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.c om/nnqweb/>
          <http://www.catb.org/~esr/faqs/smart-questions.html>
          <http://www.caliburn.nl/topposting.html >
          <http://www.netmeister. org/news/learn2quote.htm l>
          <http://cfaj.freeshell. org/google/>


          Comment

          Working...