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: How to execute "truncate table TTT" in procedures?

Re: How to execute "truncate table TTT" in procedures?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 16 Oct 2000 19:35:08 +0100
Message-ID: <971721832.333.4.nnrp-13.9e984b29@news.demon.co.uk>

Conor,

I believe you should always include a dbms_sql.execute, even though the DDL currently executes on the parse. There is a very explicit note (somewhere in the manuals) that states that the timing on the execute is not guaranteed in future releases.

BTW - there is also the simpler

    dbms_utilities.execute_ddl_statement('this is a ddl');

(though I may have both the package and procedure named incorrectly).

--

Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Connor McDonald wrote in message <39EAD9E6.40C6_at_yahoo.com>...

>qiangye_at_my-deja.com wrote:
>>
>> Dear professionals,
>>
>> Here I encounter a problem to execute "truncate table TTT" in the stored
>> procedures. It seems that "table" is the reserved key word for some
>> special use in the stored procedures, compared with in PL/SQL.
>>
>> So, anybody could let me know how to do that? Appreaications in advanc
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>
>begin
> execute immediate 'truncate table blah'
>end
>
>in 8i above, and the equivalent with dbms_sql below that...
>
>ie
>
>dbms_sql.open_cursor
>dbms_sql.parse (<your truncate>)
>dbms_sql.close
>
>HTH
>--
>===========================================
>Connor McDonald
>http://www.oracledba.co.uk
>(faster/mirrored at http://www.oradba.freeserve.co.uk)
>
>Its not the voices in my head that bother me...
> its the voices in yours.
Received on Mon Oct 16 2000 - 13:35:08 CDT

Original text of this message

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