If it errors out, the cursor stays open. What I prefer is to close the cursor explicitly. That neat, clean and you never make the mistake, just check for the %isopen before you do close though.
Raj
______________________________________________________
Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is an art!
-----Original Message-----
From: Alec Macdonell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 3:48 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: Stored procedure - cursor not closed
FOR/LOOP code references a cursor called 'all_terms' while you are asking
about 'all_rules'. Is this just a simple typing error or are you looking at
the wrong spot in your code?
Alec
-----Original Message-----
C
Sent: Wednesday, September 18, 2002 12:53 AM
To: Multiple recipients of list ORACLE-L
resending the mail. Kindly ignore my prev mail with wrong subject.
Hi All,
I ve a stored proceure and with the following cursor defined. And after
running the procedure, i see that No of open cursors incresing. I checked
it querying v$open_cursor like this. ( SELECT sql_text from v$open_cursor).
CURSOR all_rules (l_ticket_type_id NUMBER) IS
SELECT rule_id , workflow_id FROM rule
WHERE ticket_type_id = l_ticket_type_id
AND ews_flag=1
AND active_flag=1;
-- Cusror is processed as below..
FOR term_rec IN all_terms( p_rule_id ) LOOP
-- do processing
END LOOP;
Since I m using CURSOR for stemennet its closed automaticaly. right?. But it
doentnt seem closing as mentioned above ( when querried v$open_cursor). pls
reply
PS:
Also in the stored procedure I use some SELECT statements, that too is shown
when I query open_cursor as above. Do you know why no of open cursors
increasing?
Thanks in advance
Joshy
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: JOSHY MON M C
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Alec Macdonell
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).
*********************************************************************This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*********************************************************************1