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 table in stored pl/sql proc

Re: truncate table in stored pl/sql proc

From: Mark Powell <Mark.Powell_at_eds.com>
Date: 10 May 1999 15:20:35 GMT
Message-ID: <01be9af8$bd955540$a12c6394@J00679271.ddc.eds.com>


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

Original text of this message

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