Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle interface (SQL, OCI, ...)
"Curt Ingram" <cingramb_at_bigfoot.com> writes:
> begin transaction
> get first record
> while (there is a current record) {
> update it
> commit work
> begin transaction
> get another record
> }
> rollback.
>
> Here, a cursor won't fit because the work needs to be committed with each
> update. As a result, the repeated SELECTS quickly bring the processor to
> its knees.
It looks like you aren't implementing the cursor correctly. A cursor should go and get the entire result set that you would like to work on and then you rifle through it.
select all I need
while (there is a current record) do
begin trans update it commit end trans
Instead of reselecting everytime, the result set is available and you operate until you have nothing left in your result set.
Galen Boyer
Senior Database Architect
Primix Solutions
Received on Wed Mar 29 2000 - 00:00:00 CST