Technical Training
Oracle 9i TrainingOracle 9i PL/SQL Control Structures Page - 2
Oracle 9i PL/SQL Control Structures
WHILE-LOOP
This is similar to LOOP. A condition placed between WHILE and LOOP is evaluated before each iteration. If the condition evaluates to TRUE the statements are executed and the control resumes at the top of the LOOP. If the condition evaluates to FALSE or NULL then control comes out of the loop.

FOR – LOOP:
The FOR – LOOP is used to repeatedly execute a set of statements for certain number of times specified by a starting number and an ending number. The variable value starts at the starting value given and increments by 1(default and can not be changed) with each iteration. The iteration stops when the variable value reaches end value specified.
Syntax:
FOR
LOOP
Statements
END LOOP;



Sequential Control Statements
The GOTO statement is used for doing unconditional branching to a named label. Its frequent usage is not recommended. We should have at least one executable statement following the label. GOTO statements can some time result in complex, unstructured code making it difficult to understand.
Points To be remembered while working with GOTO:
- A statement, at least NULL statement, must follow every GOTO statement
- A GOTO statement can branch to enclosing block from the current block
- A GOTO statement cannot branch from one IF statement clause to another.
- A GOTO statement cannot branch from an enclosing block into a sub-block.
- A GOTO statement cannot branch out of a subprogram.
- A GOTO cannot branch from an exception handler to current block. But it can branch from the exception handler to an enclosing block
Oracle 9i Training
- Oracle 9i Utilities
- Oracle 9i Packages
- Oracle 9i Database Triggers
- Oracle 9i Procedures and Functions
- Oracle 9i PL/SQL Collections
- Oracle 9i Exception Handling
- Download example SQL Scripts used in Oracle 9i Tutorials
- Oracle 9i Cursors
- Oracle 9i PL/SQL Control Structures
- Building PL/SQL Blocks in Oracle 9i
- Oracle 9i Tables and Constraints
- More Oracle 9i Database Objects
- Introduction to Oracle 9i SQL, PLSQL, and SQL *Plus
- Oracle 9i Software Installation, SQL, PLSQL and SQL *Plus References







