CASE (Statement)
CASEexpressionWHENvalue_exprTHENaction; [WHENvalue_exprTHENaction; . . .] [ELSEaction;] END CASE;
Allows you to select one sequence of statements to execute out of many possible sequences. The CASE statement is similar to an IF-THEN-ELSIF statement. However, the CASE statement has a switch expression immediately after the keyword CASE. The expression is evaluated and compared to the value in each WHEN clause. The first WHEN clause evaluating TRUE is executed, and then control passes to the next statement following the END CASE.
If a switch expression evaluates to NULL, the ELSE case is the only one that can possibly match. WHEN NULL will never match because Oracle performs an equality comparison on the expressions.
Both the CASE statement and the CASE expression (see the next section) should include an ELSE clause that will execute statements if no WHEN clause evaluates to TRUE because PL/SQL’s runtime engine will raise an error if it finds no matching case.