Control statements are the programming statements that
make PL/SQL a full procedural complement to SQL.
A number of PL/SQL control statements can be compiled by the DB2® data server.
IF statement (PL/SQL)
Use the IF statement within PL/SQL contexts to execute
SQL statements on the basis of certain criteria.
CASE statement (PL/SQL)
The CASE statement executes a set of one or more statements
when a specified search condition is true. CASE is a standalone statement
that is distinct from the CASE expression, which must appear as part
of an expression.
Loops (PL/SQL)
Use the EXIT, FOR, LOOP, and WHILE statements to repeat
a series of commands in your PL/SQL program.
Exception handling (PL/SQL)
By default, any error encountered in a PL/SQL program stops
execution of the program. You can trap and recover from errors by
using an EXCEPTION section.
Raise application error (PL/SQL)
The RAISE_APPLICATION_ERROR procedure raises an exception
based on a user-provided error code and message. This procedure is
only supported in PL/SQL contexts.