Multiple choice technology programming languages

How many comparisons can be written in a CASE statement ?

  1. 127

  2. 255

  3. 63

  4. 511

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Oracle database, a CASE statement can have up to 255 WHEN clauses (comparisons). This is a well-documented limit in Oracle PL/SQL. Options 127 and 511 are incorrect, while 63 is far below the actual limit.

AI explanation

In many SQL dialects a CASE expression is limited to 255 WHEN comparisons because of how the parser/expression tree depth is implemented internally. This is a hard engine limit rather than a stylistic guideline, so exceeding it causes a compile-time error rather than a runtime failure.