Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. cursor out of reference

cursor out of reference

Scheduled Pinned Locked Moved Database
databasetoolshelp
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GugliMugli
    wrote on last edited by
    #1

    i'm accessing this .sql file from a .ksh(script) file. error-subprogram or cursor reference out of scope {code} declare CURSOR cur AS select a from abc; begin for i in cur loop dbms.putline('recored is' rec.recor_num); end loop

    C S G 4 Replies Last reply
    0
    • G GugliMugli

      i'm accessing this .sql file from a .ksh(script) file. error-subprogram or cursor reference out of scope {code} declare CURSOR cur AS select a from abc; begin for i in cur loop dbms.putline('recored is' rec.recor_num); end loop

      C Offline
      C Offline
      Corporal Agarn
      wrote on last edited by
      #2

      Where is your FETCH?

      1 Reply Last reply
      0
      • G GugliMugli

        i'm accessing this .sql file from a .ksh(script) file. error-subprogram or cursor reference out of scope {code} declare CURSOR cur AS select a from abc; begin for i in cur loop dbms.putline('recored is' rec.recor_num); end loop

        S Offline
        S Offline
        Simon_Whale
        wrote on last edited by
        #3

        What database is this for as it doesn't look like a SQL Server cursor TSQL Cursor[^]

        Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

        G 1 Reply Last reply
        0
        • S Simon_Whale

          What database is this for as it doesn't look like a SQL Server cursor TSQL Cursor[^]

          Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

          G Offline
          G Offline
          GuyThiebaut
          wrote on last edited by
          #4

          It looks like Oracle PL/SQL to me(I used this 7+ months ago so I could be wrong...)

          “That which can be asserted without evidence, can be dismissed without evidence.”

          ― Christopher Hitchens

          1 Reply Last reply
          0
          • G GugliMugli

            i'm accessing this .sql file from a .ksh(script) file. error-subprogram or cursor reference out of scope {code} declare CURSOR cur AS select a from abc; begin for i in cur loop dbms.putline('recored is' rec.recor_num); end loop

            S Offline
            S Offline
            Simon_Whale
            wrote on last edited by
            #5

            Not used Oracle for a while but I would have a read of this Stackoverflow: pl-sql cursor[^] it shows how you would construct your cursor. I think your problem is here

            GugliMugli wrote:

            CURSOR cur AS select a from abc;

            it should be

            declare cursor cur is
            select a from abc

            Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

            G 1 Reply Last reply
            0
            • S Simon_Whale

              Not used Oracle for a while but I would have a read of this Stackoverflow: pl-sql cursor[^] it shows how you would construct your cursor. I think your problem is here

              GugliMugli wrote:

              CURSOR cur AS select a from abc;

              it should be

              declare cursor cur is
              select a from abc

              Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

              G Offline
              G Offline
              GugliMugli
              wrote on last edited by
              #6

              sorry.. i mentioned 'AS' instead of 'IS'.. the complete cursor is CURSOR cur IS select a from abc. this is oracle pl/sql..

              1 Reply Last reply
              0
              • G GugliMugli

                i'm accessing this .sql file from a .ksh(script) file. error-subprogram or cursor reference out of scope {code} declare CURSOR cur AS select a from abc; begin for i in cur loop dbms.putline('recored is' rec.recor_num); end loop

                G Offline
                G Offline
                GugliMugli
                wrote on last edited by
                #7

                this is solved... thanks

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups