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.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. ...

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