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

Home -> Community -> Usenet -> c.d.o.server -> REPOST: Re: Closing cursors after leaving them open.

REPOST: Re: Closing cursors after leaving them open.

From: Fernão Magalhaes <barameda_at_h.o.t.m.a.i.l.com>
Date: Sun, 27 Jan 2002 14:05:50 -0800
Message-ID: <3$--$%%%_$$-_--__$@news.noc.cabal.int>


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;

sqlplus> end;
sqlplus> /

--

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

Original text of this message

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