Loop Labels Assignment Help

Assignment Help: >> Introduction to PL-SQL - Loop Labels

Loop Labels:

Such as PL/SQL blocks the loops can be labeled. A label is an undeclared identifier enclosed by doubles angle brackets, must appear at the starting of the loop statement that is given below:

<<label_name>>

LOOP

Sequence_of_statements;

END LOOP;

Optionally, the label name can also appear at the end of the loop statement, as the following instance shows:

<<my_loop>>

 LOOP

....

END LOOP my_loop;

When labeled loops are nested the ending label names can be used to improve readability. Through either form of EXIT statement not only on the current loop but also any enclosing loops can be completed. This can be done via labeling the enclosing loop which is to be completed. A label can then be used in an EXIT statement, as given below

<<outer>>

LOOP

...

LOOP

..

Exit outer WHEN...  exit both loops

End Loop;

...

End Loop outer;

Each enclosing loop up to and involving the labeled loop is exited.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd