dbTalk Databases Forums  

Question about loop conditions

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Question about loop conditions in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
amerar@iwc.net
 
Posts: n/a

Default Re: Question about loop conditions - 05-29-2008 , 12:14 PM






On May 29, 12:03 pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:
Quote:
On May 29, 12:40 pm, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) 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
Thanks everyone!!


Reply With Quote
  #12  
Old   
amerar@iwc.net
 
Posts: n/a

Default Re: Question about loop conditions - 05-29-2008 , 12:14 PM






On May 29, 12:03 pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:
Quote:
On May 29, 12:40 pm, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) 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
Thanks everyone!!


Reply With Quote
  #13  
Old   
amerar@iwc.net
 
Posts: n/a

Default Re: Question about loop conditions - 05-29-2008 , 12:14 PM



On May 29, 12:03 pm, Ed Prochak <edproc... (AT) gmail (DOT) com> wrote:
Quote:
On May 29, 12:40 pm, "ame... (AT) iwc (DOT) net" <ame... (AT) iwc (DOT) 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
Thanks everyone!!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.