Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Truncate in stored procedure

Re: Truncate in stored procedure

From: MarkP28665 <markp28665_at_aol.com>
Date: 29 Dec 1998 21:27:17 GMT
Message-ID: <19981229162717.12461.00003408@ng23.aol.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US