Re: Implicit Cursor & Explicit Cursor

From: John Dennis <jtdennis_at_atl.mindspring.com>
Date: 1996/07/11
Message-ID: <4s1huc$4cpm_at_mule2.mindspring.com>#1/1


Corry Retzke <retzke_at_i-d.com> wrote:

>Explicit cursors incur less overhead both in server time and network
>traffic. Because of compliance with and ANSI standard, implicit cursors
>actually do an extra 'FETCH' with each iteration to make sure whether
>the exception 'TOO_MANY_ROWS' needs to be raised (as when a single-row
>query returns multiple rows).
 

>As far as performance goes, I reduced response time DRAMATICALLY in a
>Forms 4.5 application by converting all IMPLICIT cursors to EXPLICIT.

My experience was exactly as Corry has said. I haven't made a implicit cursor call in some time. Explicit cursors also have the benifit of simplifing a query. If you want the "latest" record based on a where clause you can eliminate the max() aggregate by simply exiting the explicit cursor with the "exit" statement like:

FOR REC IN XYZ_CURSOR (PARM)
LOOP

	KEEP_REC := REC;
	EXIT;

END LOOP; John Dennis

John Dennis
Tactics, Inc
Atlanta, GA Received on Thu Jul 11 1996 - 00:00:00 CEST

Original text of this message