3-1. Choosing When to Execute Code
You code contains a condition, and you are interested in executing code to perform specific actions if the condition evaluates to
IF-THEN statement to evaluate an expression (or condition) and determine which code to execute as a result.
The following example depicts a very simple
IF-THEN statement that evaluates one variable to see whether it contains a larger value than another variable. If so, then the statements contained within the
IF-THEN statement are executed; otherwise, they are ignored.
DECLARE value_one NUMBER := &value_one; value_two NUMBER := &value_two; BEGIN IF value_one > value_two THEN DBMS_OUTPUT.PUT_LINE('value_one is greater than ...