Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Truncate Table Not Allowed in PL/SQL?
It used to work before Oracle 7.2. Then Oracle made it a DDL type command
by adding the STORAGE clause.
sql_curs integer;
li_rc integer;
sql_curs := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(sql_curs, 'truncate table
atcordba.gl990_temp',DBMS_SQL.NATIVE);
li_rc := DBMS_SQL.EXECUTE(sql_curs);
DBMS_SQL.CLOSE_CURSOR(sql_curs);
--
Terry Dykstra (TeamPS)
Canadian Forest Oil Ltd.
Mark Gumbs wrote in message <37393552.0_at_145.227.194.253>...
>I'm surprised the statement worked at all in a stored procedure.
>Truncate is a DDL command. You may have to use DBMS_SQL and pass the
>truncate command to it to make it work.
>
>Mark
>
>Hi wrote in message <7ha3e0$isj$1_at_nnrp1.deja.com>...
>>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 Wed May 12 1999 - 14:12:05 CDT
![]() |
![]() |