PL/SQL Flow Control
Flow control allows
the sequence of execution to be altered by some condition,
usually an IF statement, and all programming languages implement
flow control. In this chapter we discuss PL/SQL’s
implementation of flow control, focusing on the various IF/THEN
conditional statements, followed by the various loop
implementations.
In a nutshell, flow control allows the
programmer to check a condition, and decide which path the
program will take through the code. The condition checked is a
Boolean (returning either “true” or “false”). Any PL/SQL
evaluation, function, or compound statement can be used in the
check condition as long as the result is a Boolean true/false
result. In PL/SQL the condition evaluation can be enclosed in
parentheses for clarity but that is not a requirement. Let’s
take a closer look.