We should document the new syntax added in
DERBY-1576 in the CASE expression topic of the reference manual.
The variant that is currently documented in the CASE expression topic, is called "searched case". It should still be documented. In addition, the topic should show this syntax for "simple case":
whenOperand could be defined like this:
Most of this syntax is copied from the table in the Boolean expressions topic, so we may try to find some way to refactor it to avoid repetition here.
There are some inconsistencies in this definition of whenOperand. One is that I think all occurrences of "expression" could be replaced with "valueExpression". Another is that line 2 lists all comparison operators explicitly, whereas line 8 uses the shorthand "comparisonOperator". I suppose both should do the same. If we choose to use the shorthand, we should probably also define comparisonOperator somewhere.