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. Error while declaring a cursor

Error while declaring a cursor

Scheduled Pinned Locked Moved Database
helpdatabase
2 Posts 2 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.
  • V Offline
    V Offline
    VC_RYK
    wrote on last edited by
    #1

    Hi All, I am Newbie to Database and want to have all tables name and then columns of respective tables using following lines. DECLARE CURSOR TEMPCURSOR is Select table_name from all_tables where owner='FSS_ADMIN' order by TABLE_NAME; begin open TEMPCURSOR; for P in TEMPCURSOR loop select COLUMN_NAME from user_tab_columns where table_name= p.table_name; end loop; end; But while executing above lines, following error is occuring Error starting at line 1 in command: DECLARE CURSOR TEMPCURSOR is Select table_name from all_tables where owner='FSS_ADMIN' order by TABLE_NAME; begin open TEMPCURSOR; for P in TEMPCURSOR loop select COLUMN_NAME from user_tab_columns where table_name= p.table_name; end loop; end; Error report: ORA-06550: line 5, column 5: PLS-00428: an INTO clause is expected in this SELECT statement 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action: I googled to understand the issue but could not get so I request you all to help me out and I will be very thankful for your support. With regards R e h a n

    R 1 Reply Last reply
    0
    • V VC_RYK

      Hi All, I am Newbie to Database and want to have all tables name and then columns of respective tables using following lines. DECLARE CURSOR TEMPCURSOR is Select table_name from all_tables where owner='FSS_ADMIN' order by TABLE_NAME; begin open TEMPCURSOR; for P in TEMPCURSOR loop select COLUMN_NAME from user_tab_columns where table_name= p.table_name; end loop; end; But while executing above lines, following error is occuring Error starting at line 1 in command: DECLARE CURSOR TEMPCURSOR is Select table_name from all_tables where owner='FSS_ADMIN' order by TABLE_NAME; begin open TEMPCURSOR; for P in TEMPCURSOR loop select COLUMN_NAME from user_tab_columns where table_name= p.table_name; end loop; end; Error report: ORA-06550: line 5, column 5: PLS-00428: an INTO clause is expected in this SELECT statement 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action: I googled to understand the issue but could not get so I request you all to help me out and I will be very thankful for your support. With regards R e h a n

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #2

      Your syntax appears to be incorrect. Read this[^] to see how to construct a cursor.

      "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

      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