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 Not Allowed in PL/SQL?

Re: Truncate Table Not Allowed in PL/SQL?

From: Scott Hutchinson <SHUTCH_at_Globalnet.co.uk>
Date: Thu, 20 May 1999 22:37:57 +0100
Message-ID: <374480B5.44C9E745@Globalnet.co.uk>


You need to use the Dynamic SQL Package (DBMS_SQL). With this you can place DDL commands (such as Truncate) within a Stored Proc.

Scott Hutchinson
SHutch_at_Globalnet.co.uk

Big Bear wrote:

> yeah same here. they say you can't use DDL in store proc. see replies
> to my post dt 10th may
>
> Hi wrote:
>
> > A one-line stored procedure:
> >
> > CREATE OR REPLACE PROCEDURE x1 as
> > begin
> > truncate table tablex1;
> > end;
> >
> > got this error, 'PLS-00103: Encountered the symbol "TABLE" when
> > expecting one of the following: := . ( @ % ;The symbol ":= was
> > inserted before "TABLE" to continue.'
> >
> > While connected as the same user, I have no problem to execute this
> > truncate command in SQL worksheet.
> >
> > Hi Chan
> >
> > --== Sent via Deja.com http://www.deja.com/ ==--
> > ---Share what you know. Learn what you don't.---
Received on Thu May 20 1999 - 16:37:57 CDT

Original text of this message

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