Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: loop
"Connor McDonald" <connor_mcdonald_at_yahoo.com> wrote in message
news:3D4BA164.67D9_at_yahoo.com...
> Stjepan Brbot wrote:
> >
> > What is better:
> >
> > FOR xy IN curXY LOOP
> > ...
> > END LOOP;
> >
> > or
> >
> > OPEN curXY;
> > LOOP
> > FETCH curXY INTO xy;
> > IF curXY%NOTFOUND THEN
> > EXIT;
> > END IF;
> > ...
> > END LOOP;
> >
> > --
> >
> > Stjepan Brbot
>
>> b) its less code
> a) its simpler to read
>
>> ...
> for i in ( select ...
> from ... ) loop
I thought that too becuse this is the same situation like with FOR..NEXT vs. WHILE..WEND loops in other programming languages. But I wasn't sure because I had found a lot of code from very expirienced developers using the second way with %NOTFOUND.
-- Stjepan BrbotReceived on Sat Aug 03 2002 - 15:12:17 CDT
![]() |
![]() |