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

Home -> Community -> Usenet -> c.d.o.misc -> Re: commit after or before close cursor - best practise

Re: commit after or before close cursor - best practise

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Sat, 19 Nov 2005 14:28:20 +0100
Message-ID: <437f2873$0$4296$626a14ce@news.free.fr>

"Grzegorz Goryszewski" <grzegorzof_at_interia.pl> a écrit dans le message de news: dln0go$ofk$1_at_nemesis.news.tpi.pl...

| Hello,
|
|  which is better from 'best practise' perspective:


ANSI standard is close then commit.
A cursor should not be referenced across commit.

<OT>
To avoid this you can use the following: for rec in (select ...) loop
... [use rec.<fields> variables]
end loop;
commit;
Oracle will then open, fetch and close the cursor for you. You should also have a look at BULK COLLECT and collection/array variables to avoid cursor loop. </OT>

Regards
Michel Cadot Received on Sat Nov 19 2005 - 07:28:20 CST

Original text of this message

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