Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to execute "truncate table TTT" in procedures?
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>...Received on Mon Oct 16 2000 - 13:35:08 CDT
>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.
![]() |
![]() |