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
Package STANDARD package named STANDARD defines the PL/SQL atmosphere. The package specification globally declares the exceptions, types, and subprograms that are available a


How Exceptions Propagate ? Whenever an exception is raised, and if the PL/SQL cannot find a handler for it in the present subprogram or block, the exception propagates. That is


Number Types The Number types permit you to store the numeric data (real numbers, integers, and floating-point numbers), show quantities, and do computations. BINARY_INTEG

write the program for traffic control system with 10 second, 15 secod, and 20 second delay

Parameter and Keyword Description: type_name: This identifies a user-defined type specifier that is used in the subsequent declarations of the objects. AUTHID Clause:

Records Records are the items of the type RECORD. The Records have exclusively named fields that can store the data values of various types. And hence, a record treat associate

Use of COUNT in SQL It describes and discusses various general methods of expressing constraints, eventually noting that support for "=" with relation operands is sufficient f

Advantages of PL/SQL The PL/SQL is a high-performance transaction processing, completely portable language that offers the following advantages as shown: 1) Support for SQL