Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: commit after or before close cursor - best practise
"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