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 6.1 CASE Statements

Lab Objectives

After this Lab, you will be able to:

Use CASE Statements

Use Searched CASE Statements

A CASE statement has two forms: CASE and searched CASE. A CASE statement allows you to specify a selector that determines which group of actions to take. A searched CASE statement does not have a selector; it has search conditions that are evaluated in order to determine which group of actions to take.

CASE Statements

A CASE statement has the following structure:

CASE SELECTOR 
   WHEN EXPRESSION 1 THEN STATEMENT 1; 
   WHEN EXPRESSION 2 THEN STATEMENT 2; 
   … 
   WHEN EXPRESSION N THEN STATEMENT N; 
   ELSE STATEMENT N+1; 
END CASE; 

The reserved word CASE marks the beginning of the CASE statement. A selector is a value that determines ...

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