O'Reilly logo

Oracle® PL/SQL® Interactive Workbook, Second Edition by Elena Silvestrova, Benjamin Rosenzweig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lab 5.2 ELSIF Statements

Lab Objectives

After this Lab, you will be able to:

Use the ELSIF Statement

An ELSIF statement has the following structure:

IF CONDITION 1 THEN 
   STATEMENT 1; 
ELSIF CONDITION 2 THEN 
   STATEMENT 2; 
ELSIF CONDITION 3 THEN 
   STATEMENT 3; 
… 
ELSE 
   STATEMENT N; 
END IF; 

The reserved word IF marks the beginning of an ELSIF construct. The words CONDITION 1 through CONDITION N are a sequence of the conditions that evaluate to TRUE or FALSE. These conditions are mutually exclusive. In other words, if CONDITION 1 evaluates to TRUE, STATEMENT 1 is executed, and control is passed to the first executable statement after the reserved phrase END IF. The rest of the ELSIF construct is ignored. When CONDITION 1 evaluates to FALSE, control ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required