This statement searches for and returns all fields that contain a pattern similar to the pattern specified.
match_expression [NOT] LIKE pattern
match_expression
The SQL expression to compare with the pattern. This expression must be of string data type.
pattern
The pattern to search for in the match_expression parameter and can contain the percent character (%) as a wildcard.
escape_character
The character string to use as an escape character. There is no default character for escape_character and it must contain only one character.
The wildcard character (%) can be used to search for a string using one of three patterns:
|
Type of search |
Wildcard
pattern |
|
String begins with type |
LIKE 'type%' |
|
String contains type |
LIKE '%type%' |
|
String ends with type |
LIKE '%type' |
Prior to version 2.12, ADOCE did not allow for a query of the percent character (%) at the beginning or end of a string.
Constructing a statement with the wildcard character embedded in the statement, for example sam%le, results in the string being matched literally.