Re: Q about TRUCATE command within stored procedure

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 22 Jul 1999 20:37:04 +0800
Message-ID: <37971070.4562_at_yahoo.com>


Anna Sotnichenko wrote:
>
> You can issue TRUNCATE TABLE statement from PL/SQL procedure using supplied
> package DBMS_SQL. You will need to call the following functions: open_cursor,
> parse, execute, close_cursor.
> See Oracle documentation:
>
> Oracle Server Application Developer's Guide / Using Dynamic SQL
>
> IIFThen wrote:
>
> > Within a stored procedure, is there a FAST way to do the following:
> >
> > (1) delete rows
> > (2) insert rows
> > (3) update rows
> >
> > Is it possible to use the TRUNCATE command in a stored proc? The DELETE
> > command is too slow for bulk deletes. I tried the following:
> >
> > replacing DELETE FROM "tablename" with TRUNCATE TABLE "tablename" within my
> > SP.
> >
> > Get error.
> >
> > Is it because TRUNCATE is a DDL command? Is there another alternative to
> > delete bulk data within SP?
> >
> > I don't know a faster replacement for INSERT and UPDATE for bulk data within
> > an SP.
> >
> > IIFThen

or "execute_immediate" in 8i

Cheers

-- 
===========================================
Connor McDonald
"These views mine, no-one elses etc etc"
connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue."
Received on Thu Jul 22 1999 - 14:37:04 CEST

Original text of this message