Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot 'TRUNCATE TABLE <table_name>' within LOOP (Error ORA-06550)

12738Nov 6 2006 — edited Nov 6 2006
The below code generates the following error:
ORA-06550: line 26, column 14:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "TABLE" to continue.


LOOP
FETCH sat_cursor
INTO sat_data;

EXIT when sat_cursor%NOTFOUND;
dbms_output.put_line(sat_data.table_name);
v_TBLNAME := sat_data.table_name;
TRUNCATE TABLE v_TBLNAME;
END LOOP;


The truncate by itself works "TRUNCATE table cucodes"

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2006
Added on Nov 6 2006
1 comment
539 views