ALLBASE/SQL Reference Manual (36216-90216)
274 Chapter9
Search Conditions
LIKE Predicate
ProcedureParameter2
contains the escape character that is passed into or out of
a procedure.
? indicates a dynamic parameter in a prepared SQL
statement. The value of the parameter is supplied when
the statement is executed.
Description
• If an escape character is not specified, then the _ or % in the pattern continues to act as
a wildcard. No default escape character is available. If an escape character is specified,
then the wildcard or escape character which follows an escape character is treated as a
constant. If the character following an escape character is not a wildcard or the escape
character, an error results.
• If the value of the expression, the pattern, or the escape character is NULL, then the
LIKE predicate evaluates to unknown.
Example
Vendors located in states beginning with an A are identified.
SELECT VendorName FROM PurchDB.Vendors
WHERE VendorState LIKE 'A%'
Vendors whose names begin with ACME_ are identified.
SELECT VendorName FROM PurchDB.Vendors
WHERE VendorName LIKE 'ACME!_%' ESCAPE '!'