PL/SQL has a rich CASE functionality. The selector CASE statement lets you test the value of an expression (much as the DECODE function does), and it also lets you execute one or more statements for the first matching value. The searched CASE statement lets you test multiple expressions and execute one or more statements based on the first expression that is found to be true.
Unlike some languages, PL/SQL's CASE statement generates an error if none of the cases are matched. We present three ways to code around this error.