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!

testing creating a procedure to truncate and insert data.

hh39437591Dec 27 2012 — edited Jan 2 2013
I wanted to creat a procedure to truncate a table and then insert data into it.

My procedure works until I put a truncate statement in it.


I get the error message
Error(4,10): PLS-00103: Encountered the symbol "TABLE" when expecting one of the following: := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue.


Can you not do this in a procedure.

This is the code I was using to test this...

create or replace
procedure hall_test
is
begin
truncate table hr.hall_countries;
insert into hr.hall_countries (country_id,country_name,region_id)
select country_id,country_name,region_id from hr.countries;
end;

Howard
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2013
Added on Dec 27 2012
6 comments
890 views