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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Truncate statement within PL/SQL procedure won't compile!

Re: Truncate statement within PL/SQL procedure won't compile!

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 21 Feb 2001 13:22:22 +0100
Message-ID: <skc79tsqudcctbeq574e8g8jo2rdgl08nf@4ax.com>

On Wed, 21 Feb 2001 12:10:05 -0000, "Dave Sutton" <dpsutton_at_marchsystems.co.uk> wrote:

>Hi,
>
>Has anyone else experienced this?
>
>I'm logged on as the schema owner of the table in question and can
>successfully execute a truncate statement on that table outside of a PL/SQL
>procedure but as soon as I put the statement inside the procedure, the
>procedure will no longer compile!
>
>The procedure compiles if I change the TRUNCATE to a DELETE statement.
>
>What am I missing??
>
>Thanks in advance.
>
>
>Dave Sutton
>

Sure this is just standard Oracle behavior. You need dbms_sql (before Oracle 8i) or execute immediate (oracle 8i and beyond) to process ddl statements in pl/sql. Truncate is DDL, delete DML

Hth,

Sybrand Bakker, Oracle DBA Received on Wed Feb 21 2001 - 06:22:22 CST

Original text of this message

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