Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Truncate in stored procedure
From: andrewf_at_jaredgroup.com >>
I was creating a simple procedure,
Create procedure p_truncate
as
begin
truncate table employee;
end;
and got compilation error <<
You should get an error when you try to execute SQL DDL statements (create, drop, truncate...) within pl/sql, only DML statements are allowed.
To do DDL from pl/sql use the dbms_sql package. I would post the code, but I do not have a copy here at home and will not be in the office till 4 Jan. If no one posts the code, and you have trouble with the package e-mail me and I will log into work and paste it into a note for you.
Mark Powell -- Oracle 7 Certified DBA
- The only advice that counts is the advice that you follow so follow your own
advice -
Received on Tue Dec 29 1998 - 15:27:17 CST