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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Which is beter a cursor or a for loop?

Re: Which is beter a cursor or a for loop?

From: sundeep maini <sundeep_maini_at_yahoo.com>
Date: Tue, 25 Feb 2003 10:35:25 -0800
Message-ID: <F001.00558E70.20030225103525@fatcity.com>


Proof of pudding is in eating.... Whip up a couple of examples and check out the timings. I suspect the CURSOR FOR LOOPS would run faster.

I recall a similar mention by Tom Kyte in Oracle magazine while answering a question about explicit and implicit cusrsors. Unlike the conventional wisdom (a.k.a Feuerstein's recommendation in his best selling books) to use explicit cursors, he showed via an example how and why the implicit cursors are better (Key difference was the processing PL/SQL had to do for the explicit cursor).

It is pretty much the same for FOR LOOP (it opens, closes and fetches from the cursor for you) and is likly to run faster.

Sundeep Maini
Consultant
Currently on Assignement at Caterpillar Peoria sundeep_maini_k_at_cat.com



Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: sundeep maini
  INET: sundeep_maini_at_yahoo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Feb 25 2003 - 12:35:25 CST

Original text of this message

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