Re: Strange cursor behavior?

From: Brian E Dick <bdick_at_cox.net>
Date: Sat, 28 Dec 2002 02:33:06 GMT
Message-ID: <C38P9.82250$pe.2824874_at_news2.east.cox.net>


This works for me.

declare
  type c_cur is ref cursor;
  c c_cur;
  c_rec dual%rowtype;
begin
 open c for 'select dummy from dual';
  loop
    fetch c into c_rec;
    exit when c%notfound;
    dbms_output.put_line('c is ' || c_rec.dummy);   end loop;
  close c;
end;

"Vasileios Lourdas" <Vasileios.Lourdas_at_eurodyn.com> wrote in message news:3E085115.268E6DFB_at_eurodyn.com...
> Yes,
>
> Tried with exit statement after fetch.
>
> Brian E Dick wrote:
> >
> > Is this what you tried?
> >
> > declare
> > c pkg.c_type;
> > c_rec dual%rowtype;
> > begin
> > open c for 'select dummy from dual';
> > loop
> > fetch c into c_rec;
> > exit when c%notfound;
> > dbms_output.put_line('c is ' || c_rec.dummy);
> > end loop;
> > close c;
> > end;
> >
Received on Sat Dec 28 2002 - 03:33:06 CET

Original text of this message