Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Cursors ...
"Meinhard Schnoor-Matriciani" <Meinhard_at_NewYorker.de> wrote in message news:<1020720050.690708_at_beavis>...
> Hi togehter !
>
> I am in the need of writing a SP which generates new rows i a table. I am
> doing that using a cursor and loop through the result set. Unfortunately
> it's not allowed to use subselects in a cursor, so wrote a set of function
> which return the requested column values. Now the problem ist, that this
> technique seems to consume a lot of time ( 500msec with the functions , 20ms
> in interactive mode using subselects ). Does anybody have an advice what to
> do ?
You can do your inserts in two steps. In first step you can prepare data to be inserted in using all ways available in PL/SQL (selects,
functions ...) and after everything is OK, you can in second step use one FOR ALL ... statement and insert your data via BULK BINDING, which si damn fast.
-- _________________________________________ Dusan Bolek, Ing. Oracle team leader Note: pagesflames_at_usa.net has been cancelled due to changes (maybe we can call it an overture to bankruptcy) on that server. I'm still using this email to prevent SPAM. Maybe one day I will change it and have a proper mail even for news, but right now I can be reached by this email.Received on Tue May 07 2002 - 01:43:25 CDT