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