Iterative control: loop statement, PL-SQL Programming

Iterative Control: LOOP  Statements

The LOOP statement executes a series of statements multiple times. There are 3 forms of LOOP statements: LOOP, WHILE-LOOP, & FOR-LOOP.

LOOP

The simplest form of the LOOP statement is the basic loop that encloses a series of statements between the keywords LOOP and END LOOP which is as shown:

LOOP
sequence_of_statements
END LOOP;

With each of the iteration of the loop, the series of statements is executed, then the control resumes at the top of the loop. If extra processing is undesirable or impossible, you may use an EXIT statement to complete the loop. You may place one or more EXIT statements wherever inside a loop, but nowhere outside a loop. There are 2 forms of EXIT statements: EXIT and EXIT-WHEN.

Posted Date: 10/3/2012 5:44:05 AM | Location : United States







Related Discussions:- Iterative control: loop statement, Assignment Help, Ask Question on Iterative control: loop statement, Get Answer, Expert's Help, Iterative control: loop statement Discussions

Write discussion on Iterative control: loop statement
Your posts are moderated
Related Questions
Inserting Objects: You can use the INSERT statement to add objects to an object table. In the illustration below, you insert a Person object into the object table persons:

Package STANDARD package named STANDARD defines the PL/SQL atmosphere. The package specification globally declares the exceptions, types, and subprograms that are available a

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

Set Operators The Set operators combine the results of the two queries into one result. The INTERSECT returns all the distinct rows selected by both queries. The MINUS returns

Third Step at defining type SID in SQL CREATE DOMAIN SID AS VARCHAR(5) CHECK ( VALUE IS NOT NULL AND SUBSTRING(VALUE FROM 1 FOR 1) = 'S' AND CAST('+'||SUBSTRING(VALUE

Datatypes Every constant and variable has a datatype that specifies the storage format, constraints, and the valid range of values. The PL/SQL gives a variety of predefined dat

COMMIT Statement The COMMIT statement explicitly makes everlasting changes to the database during the present transaction. The Changes made to the database are not considered e

SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Table Literals - SQL One might expect SQL to support table literals in the manner illustrated in Example 2.2, but in fact that is not a legal SQL expression. Example: Not a

Declaring a Cursor The Forward references are not allowed in the PL/SQL. Therefore, you must declare a cursor before referencing it in other statements. Whenever you declare a