ODBC Server Reference Manual

CORE SQL Language
HP NonStop ODBC Server Reference Manual429151-002
3-29
CASE Expression
Character comparisons are case sensitive. For example, the following comparison
would locate the string “sanitary” but not the string “San Francisco.”
%san%
For more information, see the following documents:
CASE Expression
The NonStop ODBC Server supports the CASE expression in queries. The syntax is
the same as the NonStop SQL/MP syntax, except that you use NonStop ODBC logical
names instead of NonStop SQL/MP names:
case-expression
specifies a value expression that is compared to the value expressions in each
WHEN clause of a simple CASE. The data type of each expression in the
WHEN clause must be comparable to the data type of case-expression.
Table 3-7. NonStop ODBC Server Support of Wild-Card Characters
CORE SQL Wild-Card Character NonStop ODBC Server Support
%x
_x
For Information About See
Wild-card characters in CORE SQL X/Open CAE Specification
Wild-card characters in NonStop SQL/MP NonStop SQL/MP Reference Manual
Simple CASE is:
CASE case-expression
WHEN expression-1 THEN {result-expression-1 | NULL}
WHEN expression-2 THEN {result-expression-2 | NULL}
...
WHEN expression-n THEN {result-expression-n | NULL}
[ELSE {result-expression | NULL}]
END
Searched CASE is:
CASE
WHEN search-condition-1 THEN {result-expression-1 | NULL}
WHEN search-condition-2 THEN {result-expression-2 | NULL}
...
WHEN search-condition-n THEN {result-expression-n | NULL}
[ELSE {result-expression | NULL}]
END