-----Original Message-----
From: Smith, Ron L. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 06, 2003 5:09 PM
To: Multiple recipients of list ORACLE-L
Subject: Help with a truncate command in a procedureI am not a coder but I received this from one of our developers. I can't find anything about this anywhere. Can someone tell me how to make the truncate work?
Thanks!
R.Smith
In a DB procedure, I wanted to include the following SQL:
BEGIN
TRUNCATE TABLE LOT837_GLOBAL_TBL_KMG;
END;Error messages:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "TABLE" to continue.
(It does not like it, if you take out TABLE, either.)So, I had to settle for the following SQL:
BEGIN
DELETE LOT837_GLOBAL_TBL_KMG;
END;Do you know why I can not use the TRUNCATE command?
If you are not the intended recipient of this e-mail message, any use, distribution or copying of the message is prohibited. Please let me know immediately by return e-mail if you have received this message by mistake, then delete the e-mail message. Thank you.
Title: Help with a truncate command in a procedure
Truncate is a DDL. So you can't just do
"truncate" like you would with delete which is a DML.
You
didn't say which version of Oracle you are running. If it's 8i,
do
execute immediate "truncate table
.........";
Otherwise, look into DBMS_SQL.
Richard Ji
- Help with a truncate command in a procedure Smith, Ron L.
- RE: Help with a truncate command in a procedure Richard Ji
- RE: Help with a truncate command in a procedure Jacques Kilchoer
- RE: Help with a truncate command in a procedure Stephen Lee
- Re: Help with a truncate command in a procedure Joe Testa
- Re: Help with a truncate command in a procedure Mark Richard
- RE: Help with a truncate command in a procedure Smith, Ron L.
- RE: Help with a truncate command in a procedure Bernard, Gilbert
