Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: truncate table in stored pl/sql proc
Truncate table is a DDL (data definition language) command and DDL is not
supported in pl/sql. You can issue the command from a pl/sql procedure
using the dbms_sql package to dynamically generate the command.
Here is the code: (Note you may want to add some type of authorized table name check to this)
create or replace procedure owner.TRUNCATE_TABLE
(
table_name varchar2,
storage_type varchar2
)
as
--
Big Bear <ta_xiong_at_hotmail.com> wrote in article <3736EE84.2901613B_at_hotmail.com>...
> hello, > > could anyone out there tell me if it is possible to include truncate > table command in a pl/sql stored procedure. i tried it but when i > compile it gives error "expecting 'table' when expecting......" > > thanks & regards. >Received on Mon May 10 1999 - 10:20:35 CDT
![]() |
![]() |