solidDB Help : solidDB reference : SQL: Statements : Wildcard characters : Wildcard characters as literals
  
Wildcard characters as literals
A wildcard character can be used in one part of a string while the literal character % (percent) or underscore ( _ ) can be used in another part of the same string.
To use a wildcard character as a literal, preface the wildcard character with an escape character and specify the escape character itself as part of the query, as shown in the following example:
... LIKE string {ESCAPE escape‑character}
For example, the following expression uses the backslash character ( \ ) as the escape character:
LIKE 'MY\_EXPRESSION_' ESCAPE '\';
The above expression matches the following values:
MY_EXPRESSION1
MY_EXPRESSIONA
MY_EXPRESSION_
The above expression does not matches the following value:
MY#EXPRESSION1
Note As per ANSI standard, character strings must be delimited by single quotation marks.
For example:
...LIKE ' J_N_'; -- CORRECT ...LIKE "J_N_"; --WRONG
Double quotation marks are used for delimited identifiers, not data. This is different from C and Java languages as they uses double quotation marks to delimit strings as in "C‑language string" and single quotation marks 'C' to delimit single characters.
Go up to
Wildcard characters