Lab 5.1 IF Statements

Lab Objectives

After this Lab, you will be able to:

Use IF-THEN Statements

Use IF-THEN-ELSE Statements"/>

An IF statement has two forms: IF-THEN and IF-THEN-ELSE. An IF-THEN statement allows you to specify only one group of actions to take. In other words, this group of actions is taken only when a condition evaluates to TRUE. An IF-THEN-ELSE statement allows you to specify two groups of actions, and the second group of actions is taken when a condition evaluates to FALSE or NULL.

IF-THEN Statements

An IF-THEN statement is the most basic kind of a conditional control and has the following structure:

IF CONDITION THEN 
   STATEMENT 1; 
   … 
   STATEMENT N; 
END IF; 

The reserved word IF marks the beginning of the IF statement. ...

Get Oracle® PL/SQL® Interactive Workbook, Second 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.