SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-95
NULL Predicate
Examples of LIKE
Find all employee last names beginning with ZE:
last_name LIKE 'ZE%'
Find all job titles that match a specific string provided at execution time:
jobdesc LIKE ?SOMEJOB
This predicate example is a part of a prepared statement where the parameter
value of SOMEJOB is provided at execution time.
Find all part descriptions that are not 'FLOPPY_DISK':
partdesc NOT LIKE 'FLOPPY\_DISK' ESCAPE '\'
The escape character indicates that the underscore in ‘FLOPPY_DISK’ is part of
the string to search for, not a wild-card character.
NULL Predicate
The NULL predicate determines whether all the expressions in a sequence are null.
See Null on page 6-76.
row-value-constructor
specifies the operand of the NULL predicate. The operand can be either of these:
(expression [,expression ]...)
is a sequence of SQL value expressions, separated by commas and enclosed
in parentheses. expression cannot include an aggregate function unless
expression is in a HAVING clause. expression can be a scalar subquery
(a subquery that returns a single row consisting of a single column). See
Expressions on page 6-37.
row-subquery
is a subquery that returns a single row (consisting of a sequence of values).
See Subquery on page 6-105.
If all of the expressions in the row-value-constructor are null, the IS NULL
predicate is true. Otherwise, it is false. If none of the expressions in the row-value-
constructor are null, the IS NOT NULL predicate is true. Otherwise, it is false.
row-value-constructor IS [NOT] NULL
row-value-constructor is:
(expression [,expression]...)
| row-subquery