Re: Deleting all rows from a table

From: Steve Long <answers_at_ix.netcom.com>
Date: 1996/06/17
Message-ID: <4q2em4$qgh_at_sjx-ixn2.ix.netcom.com>#1/1


PL/SQL allows only DML statements. Truncate is a DDL statement. Try using the file utility (SQL new with 7.2 or 7.3, i forget which off hand) to invoke an external SQL*Plus script to run the truncate command.

In <4prtk1$j4o_at_big.info.att.com> bharat_at_allegra.tempo.att.com (Bharat Kumar) writes:
>
>
>I'm writing a PL/SQL procedure that requires the use of a couple of
 temporary
>tables. Currently, I've created those temp. tables outside the
 procedure,
>and inside the procedure, after I'm done with the main work, I delete
 all
>the rows in those temp tables (required for subsequent invocations of
 the
>procedure). I would like to use something similar to a "truncate"
 command,
>since the "delete from temp_table" command takes a long time. However,
 I
>can't put the truncate command directly into the procedure. Any
 suggestions?
>
>Here's the psuedocode for the procedure:
>
> procedure blah
> insert into temp_table (subquery...)
> ... select/project/join queries on the temp_table
> delete from temp_table;
> end blah;
>
>
>Please post replies to this newsgroup.
>
>Thanks,
>-Bharat
>
>----------------------------------------------------------------------



>Disclamer: My opinions are mine alone, and no one else can have them.
Received on Mon Jun 17 1996 - 00:00:00 CEST

Original text of this message