Loop labels- iterative control, PL-SQL Programming

Loop Labels

Like the PL/SQL blocks, loops can also be labeled. The label, an undeclared identifier enclosed by double angle brackets, should appear at the beginning of the LOOP statement, as shown:

<>
LOOP
sequence_of_statements
END LOOP;

Optionally, the label name can also come out at the end of the LOOP statement, as the illustration below shows:

<>
LOOP
...
END LOOP my_loop;


If you nest labeled loops, you can use the ending label names to improve the readability. With either form of the EXIT statement, you cannot complete only the current loop, but also any of the enclosing loops. Merely, label the enclosing loop that you want to done. Then, use the label in an EXIT statement, as shown:

<>
LOOP
...
LOOP
...
EXIT outer WHEN ... -- exit both loops
END LOOP;
...
END LOOP outer;

Posted Date: 10/3/2012 5:49:01 AM | Location : United States







Related Discussions:- Loop labels- iterative control, Assignment Help, Ask Question on Loop labels- iterative control, Get Answer, Expert's Help, Loop labels- iterative control Discussions

Write discussion on Loop labels- iterative control
Your posts are moderated
Related Questions
UPDATE Command- SQL Loosely speaking, UPDATE changes some of the column values of some existing rows of its target table. Thus, although some rows disappear from the target an

Using research notes and Oracle documentation plan and execute an upgrade of an installation of Oracle 10g to Oracle 11g release 1. To do this you must show in screen shots and wri

THEO R Y OF SPECIAL CREATION - Life originated on the earth due to natural events by the super natural power. The biblical story of creation of world within six days was p

1- You can check attribute names from each table in DBF11 by running for example:  desc dbf11.Member;  desc dbf11.Agent;  desc dbf11.Producer; Because some attribute names in

i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

Exception handling In the PL/SQL, a warning or error condition is known as an exception. The Exceptions can be internally defined (by the run-time system) or user defined. The

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT.  A screen dump of the output is acceptable. Show as many rows as you can. A screen dump i

Special cases of projection This section describes the identity projection, r {ALL BUT}, and the projection on no attributes, r { }, which yields TABLE_DUM when r is empty, ot

to write a heap sort program usin pl-sql

Example of Check Constraints Example: Workaround for when subqueries not permitted in CHECK constraints CREATE FUNCTION NO_MORE_THAN_20000_ENROLMENTS ( ) RETURNS BOOLEAN