December 2010
Intermediate to advanced
451 pages
11h 16m
English
You code contains a condition, and you are interested in executing code to perform specific actions if the condition evaluates to TRUE, FALSE, or NULL.
Use an 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 ...Read now
Unlock full access