Skip Headers
Previous
Previous
 
Next
Next

Pattern-Matching Conditions

The pattern-matching conditions compare character data.

LIKE Operators

The LIKE operators specify a test involving pattern matching. Whereas the equality operator (=) exactly matches one character value to another, the LIKE operators can match patterns defined by special pattern-matching ("wildcard") characters.

You can choose from these LIKE operators:

LIKE Pattern-Matching Operators

Operator Description

LIKE

Uses characters in the input character set.

LIKEC

Uses Unicode complete characters. It treats a Unicode supplementary character as two characters.

LIKE2

Uses UCS2 code points. It treats a Unicode supplementary character as one character.

LIKE4

Uses UCS4 code points. It treats a composite character as one character.


Syntax

char1 [ NOT ] ( LIKE | LIKEC | LIKE2 | LIKE4 )
  char2 [ ESCAPE esc_char ]

Arguments

char1 is a text expression for the search value.

char2 is a text expression for the pattern. The pattern can contain these wildcard characters:

esc_char is a text expression, usually a literal, that is one character long. This escape character identifies an underscore or a percent sign in the pattern as literal characters instead of wildcard characters. You can also search for the escape character itself by repeating it. For example, if @ is the escape character, then you can use @% to search for % and @@ to search for @.

Examples

'Ducks' LIKE 'Duck_' and 'Ducky' LIKE 'Duck_' are true.

'Duckling' LIKE 'Duck_' is false.

'Duckling' LIKE 'Duck%' is true.