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

From: Galen Boyer <gboyergolf_at_yahoo.com>
Date: 29 Mar 2000 20:25:21 -0500
Message-ID: <uwvmltfjy.fsf_at_yahoo.com>


"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 Thu Mar 30 2000 - 03:25:21 CEST

Original text of this message