11.10. IF Statement

The IF construct implements IF-THEN-ELSE logic with optional ELSIF clauses.

11.10.1. Simple IF

The simple IF statement performs an action based on a true-false condition, illustrated by the diamond in Figure 11-1. If the condition evaluates TRUE, the code executes the logic in the box.

Figure 11-1. Simple IF.

An example is:

IF (a < 10) THEN b := 1; END IF;

11.10.2. If-Then-Else

An IF-THEN-ELSE statement, shown in Figure 11-2, performs an action based on a true-false condition. An alternative action is always performed. If the test evaluates TRUE, the code executes the logic in that box, otherwise it executes the logic in ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.