Loop labels- iterative control, PL-SQL Programming

Assignment Help:

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;


Related Discussions:- Loop labels- iterative control

Effects of null in aggregate operator - sql, Effects of NULL in Aggregate O...

Effects of NULL in Aggregate Operator - SQL Let aggop(x) be an invocation of some aggregate operator aggop in SQL, where x is an expression (usually an open expression) to be

Relational algebra, Define basic operators of relational algebra with an ex...

Define basic operators of relational algebra with an example each

Cursors, What is Cursors how to use it in Real time application ?

What is Cursors how to use it in Real time application ?

Package dbms output in pl/sql, DBMS_OUTPUT: The Package DBMS_OUTPUT en...

DBMS_OUTPUT: The Package DBMS_OUTPUT enables you to display output from the PL/SQL subprograms and blocks, that makes it easier to test and debug them. The procedure put_ line

Closest approximation to relational union - sql, Closest Approximation to R...

Closest Approximation to Relational Union - SQL Actually, just as SQL has several varieties of JOIN, it also has several varieties of UNION, none of which is equivalent to th

Fetch statement - syntax, FETCH Statement The FETCH statement retrieve ...

FETCH Statement The FETCH statement retrieve rows of data one at a time from the result set of the multi-row query. The data is stored in fields or variables which correspond t

Logical operators-pl/sql expressions , Logical Operators The logical op...

Logical Operators The logical operators AND, NOT, and OR follow the tri-state logic shown in table below. The AND and OR are binary operators; NOT is a unary operator.

Stored subprograms, Stored Subprograms Normally, tools (like Oracle Fo...

Stored Subprograms Normally, tools (like Oracle Forms) which incorporate the PL/SQL engine can store subprograms locally for later, strictly local execution. Though, to become

Assignment statement in pl sql, Assignment Statement: The assignment s...

Assignment Statement: The assignment statement sets the present value of the variable, parameter, field, or element. The statement consists of an assignment target followed by

Python function, This task involves developing some functions that extract ...

This task involves developing some functions that extract data from an SQL database. The scenario is that a company which owns an online vehicle search website wants to generate so

Write Your Message!

Captcha
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