NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
L-5
Examples—LIKE
Suppose you want to select all names that end with the letter y. If you define the
pattern-matching string as “%y@,” the following statement finds all names
ending in y (provided that no trailing blanks are entered):
>> SELECT NAME FROM EMPLOYEE
+> WHERE NAME LIKE "%y@"
+> TERMINATE "@";
NAME
----
Jay
Holly
The character sets associated with the column, the LIKE pattern, the ESCAPE
character, and the TERMINATE character must be the same.
When two-character strings are considered equivalent to one-character strings, LIKE
might not return the expected result. For example, if a-umlaut is considered equal to
ae, LIKE a% does not return a match on string a-umlaut.
Examples—LIKE
The following LIKE predicate finds all employee names beginning with ZB:
EMPNAME LIKE "ZB%"
The following LIKE predicate finds all job titles that match a specific string
provided at execution time:
JOB LIKE ?SOMEJOB
The following LIKE predicate finds all part descriptions that are not
FLOPPY_DISK. The escape character indicates that the backslash in
“FLOPPY_DISK” is part of the string to search for, not a wild-card character.
PARTDESC NOT LIKE "FLOPPY\_DISK" ESCAPE "\"
The following LIKE predicate specifies that the column NAME is associated with
the ISO88591 character set. The predicate finds the value A_B:
NAME LIKE _ISO88591"A\_B" ESCAPE _ISO88591"\"
Limits
NonStop SQL/MP has limits on the size and number of objects, on the size of columns,
on file attributes, and on other items you use with NonStop SQL/MP.
SQL uses information stored in file labels and special records in the disk volume
directory that contain information about a table, view, partition, or catalog. As a result,
some limits depend on the size of file labels, which have a block size of 4096.
NonStop SQL/MP limits are summarized in the following alphabetic list of items: