-
When using CURSORS, it was always important to have an EXCEPTION clause that would close the cursor and raise the error if anything went wrong. This was necessary, based on my understanding, because if the proc exited without closing the cursor, the OPEN CURSOR count would not be decremented and eventually this would cause a problem.
The question is: Do REF CURSORs suffer the same fate?
So, if I declare a local variable within a proc as a REF CURSOR (type), then I OPEN it for something, do I even need to CLOSE it at all?
I am personally of the opinion that I do not. I believe that the cursor will 'close' when it goes out of scope, the resultset will be released and there will be no ill-effects.
Does anyone have any information for or against this position?
Thanks,
- Chris
-
Acording to Tom Kyte (and I've never read anything from him that would make me doubt in what he says) you should treat ref cursors just like normal cursors, ie close them when you are done with them.
http://asktom.oracle.com/pls/ask/f?p...:1606716582692
http://asktom.oracle.com/pls/ask/f?p...:1928887333955
http://asktom.oracle.com/pls/ask/f?p...:1401210350504
[Edited by jmodic on 01-31-2002 at 05:46 PM]
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
Excellent info as always Jurij.
I should have searched Tom's site myself (bad programmer!)
Thanks,
- Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|