From: "Ivica Dimjasevic" <smokesoft@email.hinet.hr>
Newsgroups: comp.databases.oracle
Subject: FETCH
Date: Wed, 12 Dec 2001 13:10:20 +0100
Organization: HThinet
Lines: 34
Message-ID: <9v7hft$9hq6$1@as201.hinet.hr>
NNTP-Posting-Host: 195.29.176.77
Mime-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-2"
Content-Transfer-Encoding: 7bit
X-Trace: as201.hinet.hr 1008159037 313158 195.29.176.77 (12 Dec 2001 12:10:37 GMT)
X-Complaints-To: abuse@hinet.hr
NNTP-Posting-Date: Wed, 12 Dec 2001 12:10:37 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000


Hi! Let say I have PL/SQL procedure:

CREATE OR REPLACE my_proc IS

  CURSOR my_cur SELECT * FROM my_table;
  my_rec my_cur%ROWTYPE;

BEGIN
  OPEN my_cur;

  LOOP
    FETCH my_cur INTO my_rec;
    EXIT WHEN my_cur%NOTFOUND;
    ...
  END LOOP;

  -- Here I want to do it again with different code.
  LOOP
    FETCH my_cur INTO my_rec;
    EXIT WHEN my_cur%NOTFOUND;
    ...
  END LOOP;

  CLOSE my_cur;
END;

Is it possible to FETCH all rows again from the beginning without closing
and reopening cursor?
Thanks.

--
Ivica Dimjasevic
http://come.to/smokesoft/


