EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 260

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Search conditions
242
If an escape-expr is specified, it must evaluate to a single character. The
character can precede a percent, an underscore, a left square bracket, or
another escape character in the pattern to prevent the special character from
having its special meaning. When escaped in this manner, a percent will
match a percent, and an underscore will match an underscore.
All patterns of length 126 characters or less are supported. Patterns of length
greater than 254 characters are not supported. Some patterns of length
between 127 and 254 characters are supported, depending on the contents of
the pattern.
A set of characters to look for is specified by listing the characters inside
square brackets. For example, the following condition finds the strings smith
and smyth:
... LIKE ’sm[iy]th’
A range of characters to look for is specified by giving the ends of the range
inside square brackets, separated by a hyphen. For example, the following
condition finds the strings bough and rough, but not tough:
... LIKE ’[a-r]ough’
The range of characters [a-z] is interpreted as "greater than or equal to a, and
less than or equal to z", where the greater than and less than operations are
carried out within the collation of the database. For information on ordering
of characters within a collation, see "International Languages and Character
Sets" on page 287 of the book ASA User’s Guide.
The lower end of the range must precede the higher end of the range. For
example, a LIKE condition containing the expression [z-a] returns no rows,
because no character matches the [z-a] range.
Unless the database is created as case-sensitive, the range of characters is
case insensitive. For example, the following condition finds the strings
Bough, rough, and TOUGH:
... LIKE ’[a-z]ough’
If the database is created as a case-sensitive database, the search condition is
case sensitive also.
You can combine ranges and sets within a square bracket. For example, the
following condition finds the strings bough, rough, and tough:
... LIKE ’[a-rt]ough’
The bracket [a-mpqs-z] is interpreted as "exactly one character that is either
in the range a to m inclusive, or is p, or is q, or is in the range s to z
inclusive".
Searching for one
of a set of
characters
Searching for one
of a range of
characters
Combining
searches for
ranges and sets

Table of Contents

Related product manuals