Title: RE: Help with a truncate command in a procedure

(pant pant)
Will I be the first to say that you need to use dynamic SQL?
dbms_sql package in Oracle version < 8.1
execute immediate in Oracle version >= 8.1

-----Original Message-----
From: Smith, Ron L. [mailto:[EMAIL PROTECTED]]

I 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?

Reply via email to