SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
L-2
LIKE Predicate
LIKE Predicate
LIKE is a predicate that searches for character strings matching a pattern.
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.
char-exp [NOT] LIKE pattern [ ESCAPE char ]
[ TERMINATE { char } ]