Re: Deleting all rows from a table

From: Eric Albacete <ealbacet_at_ix.netcom.com>
Date: 1996/06/17
Message-ID: <4q2hdd$7jp_at_dfw-ixnews8.ix.netcom.com>#1/1


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.


You can use truncate in PL/SQL, but only with dynamic SQL.

Eric Albacete Received on Mon Jun 17 1996 - 00:00:00 CEST

Original text of this message