Re: Strange cursor behavior?

From: Vasileios Lourdas <lourdas_at_otenet.gr>
Date: Sun, 29 Dec 2002 23:07:48 +0200
Message-ID: <auno72$dv8$1_at_nic.grnet.gr>


Yes, this works. It looks like i messed up with the lines with fetch and exit when.

Thank you all.

"Brian E Dick" <bdick_at_cox.net> wrote in message news: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 Sun Dec 29 2002 - 22:07:48 CET

Original text of this message