Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Truncate command in Procedures

Re: Truncate command in Procedures

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Sat, 21 Aug 1999 07:06:03 +0200
Message-ID: <935211989.9015.0.pluto.d4ee154e@news.demon.nl>


Truncate is a ddl statement. Ddl statements are not allowed in pl/sql, = unless you process them by dbms_sql (Oracle 7). In Oracle 8 there is a = distinct package to do that, and that ought to be documented in the = Application Developers Guide.

Hth,

Sybrand Bakker, Oracle DBA

  bwest <bwest_at_sdsc.edu> wrote in message = news:37BDCA81.AA7BBE23_at_sdsc.edu...
  I am attempting to create a procedure containing SQL truncate = statements
  as in the following:
  create procedure prep_database_sp
  as
  BEGIN   truncate table ol_summary;
  truncate table employee_appointment;   truncate table labor_distribution;
  delete from employee;
  delete from active_index;
  delete from index_fund_xref;

  END;   This fails to compile with the truncate statement although the Oracle   Handbook cites no restriction on the type of SQL statements that can = be
  put in the body of a procedure.

  I get the following error message:

  PLS-00103 Encountered the symbol "TABLE" when expecting the one of the =

  following: := . ( @ % ;

  Is there anyway to use truncate or is this an 'undocumented feature'?      Received on Sat Aug 21 1999 - 00:06:03 CDT

Original text of this message

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