Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle interface (SQL, OCI, ...)

Re: Oracle interface (SQL, OCI, ...)

From: Galen Boyer <gboyergolf_at_yahoo.com>
Date: 2000/03/29
Message-ID: <uwvmltfjy.fsf@yahoo.com>#1/1

"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

done

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US