Re: Question about loop conditions

From: Ed Prochak <edprochak_at_gmail.com>
Date: Thu, 29 May 2008 10:03:16 -0700 (PDT)
Message-ID: <d5fa9aac-148f-4291-bcd4-f7fd009c11b6@34g2000hsh.googlegroups.com>


On May 29, 12:40 pm, "ame..._at_iwc.net" <ame..._at_iwc.net> wrote:
> Hi,
>
> When you have a loop and use the "EXIT WHEN" clause, can you use it
> more than once?

Yes.

> What if you have multiple places in the code where
> you might want to exit?

Yes that works too.
>
> LOOP
> v_position := INSTR(v_expression,','); --- Want to exit here if
> v_position = 0;
> v_numbers(v_sub) := SUBSTR(v_expression,1,v_position-1);
> v_expression := SUBSTR(v_expression,v_position+1);
> v_position := INSTR(v_expression,','); --- --- Want to
> exit here if v_position = 0;
> v_operators(v_sub) := SUBSTR(v_expression,1,1);
> v_expression := SUBSTR(v_expression,v_position+1);
> END LOOP;
>
> Thanks!

All that typing to ask us when all you needed to do was try it to find out it works.
FYI you can check all the oracle documentation on-line. here's the link to the master index:
http://www.oracle.com/pls/db102/show_mindex

Enjoy.
  Ed Received on Thu May 29 2008 - 12:03:16 CDT

Original text of this message