A searched CASE statement uses one or more Boolean expressions to determine the resulting set of statements to execute.
boolean-expression is evaluated in the order in which it appears within the CASE statement. When the first boolean-expression is encountered that evaluates to TRUE, the statement(s) in the corresponding THEN clause are executed and control continues following the END CASE keywords. If none of boolean-expression evaluates to TRUE, the statement(s) following ELSE are executed. If none of boolean-expression evaluates to TRUE and there is no ELSE clause, an exception is thrown.
The following example uses a searched CASE statement to assign a department name and location to a variable based upon the department number.