Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> REPOST: Re: Closing cursors after leaving them open.
I tried running an anonymous PL/SQL procedure several times, without
closing the cursor, and it executed successfully. Can you clarify how
you arrived to the error below?
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 CURSOR c1 IS SELECT deptno FROM dept;
3 v NUMBER;
4 BEGIN
5 OPEN c1;
6 FETCH c1 INTO v;
7 dbms_output.put_line(v);
8 END;
9 /
10
PL/SQL procedure successfully completed.
SQL> /
10
PL/SQL procedure successfully completed.
--Fernão
DBA wannabe
"Galen Boyer" <galenboyer_at_hotpop.com> wrote in message
news:ubsfkz0dw.fsf_at_rcn.com...
When I open but don't close a cursor in pl/sql code, and then I
try to open it again, I, of course, get cursor still open.
How do I tell Oracle through sqlplus to close that currently open cursor?
I've tried:
sqlplus> close c1;
sqlplus> close cursor c1;
sqlplus> declare sqlplus> cursor c1 as blah; sqlplus> begin sqlplus> close c1; sqlplus> end; sqlplus> / sqlplus> begin sqlplus> close c1;
--
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.
This message was cancelled from within The Unacanceller's glorious new software, Lotus 1-2-3 For Rogue Cancellers. Received on Sun Jan 27 2002 - 16:05:50 CST