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: using a cursor for loop with bulk collect?

Re: using a cursor for loop with bulk collect?

From: Connor McDonald <hamcdc_at_yahoo.co.uk>
Date: Fri, 1 Oct 2004 17:00:57 +0100 (BST)
Message-ID: <20041001160057.32690.qmail@web86902.mail.ukl.yahoo.com>


Not in v9 as far as I know.

In v10, a cursor-for-loop is automatically transformed to bulk collect (very very cool that feature) so it might save you the effort.

The other option (is the evaluation of the predicates isn't too expensive) is to loop via rownum, ie

loop
  delete from ...
  where <predicates>
  and rownum < <size_per_batch>;

  exit when sql%notfound or <other condition>;   commit;
end loop;
commit;

hth
connor


Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions" ISBN: 1590592174 web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald_at_yahoo.com

Coming Soon! "Oracle Insight - Tales of the OakTable"

"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"


                                  
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun!  http://uk.messenger.yahoo.com
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Oct 01 2004 - 10:56:42 CDT

Original text of this message

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