NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
L-2
Considerations—LIKE
char-exp
is a character expression that specifies the set of strings to search for matches to
pattern.
pattern
is a character expression that does not contain a column name and that specifies the
pattern string for the search.
ESCAPE char
specifies a literal, host variable (preceded by a colon), or parameter that contains a
single character to use as an escape character to turn off the special meaning of
percent and underscore.
If the column is associated with a single-byte character set, char must be one
single-byte character. If the column is associated with a double-byte character set,
char must be one double-byte character.
TERMINATE char
specifies a literal, host variable (preceded by a colon), or parameter that contains a
single character to use to indicate the end of the pattern within the pattern string.
Use this clause when the column value and the comparison value are different
lengths.
If you specify both ESCAPE and TERMINATE, the values for char must be
different in each clause.
If the column is associated with a single-byte character set, char must be one
single-byte character. If the column is associated with a double-byte character set,
char must be one double-byte character.
Considerations—LIKE
The values you compare must be character strings. Lowercase and uppercase letters
are not equivalent. To make lowercase letters match uppercase letters, use UPSHIFT.
The LIKE predicate is true if the value matches any string in the column to which
you compare the value.
If the values you compare are both empty strings (that is, strings of zero length), the
LIKE predicate is true.
A blank is compared in the same way as any other character.
If the value of col-name is null or if host-variable or param-name
contains INDICATOR clauses that specify a null value, the LIKE predicate
evaluates to null.
You can use only parameters in a prepared dynamic SQL statement or in a statement
you enter through SQLCI.