Library /sys$common/syshlp/SQL$HELP_OLD72.HLB  —  Predicates  LIKE Predicate
    A LIKE predicate searches character string literals for pattern
    matches. The LIKE predicate is case sensitive; it considers
    uppercase and lowercase forms of the same character to be
    different characters.

    Because the LIKE predicate is case sensitive, searches for
    uppercase characters do not include lowercase characters in
    any Multinational Character Set. The reverse is also true. For
    example, LIKE "Ç" will retrieve a different set of records than
    LIKE "ç".

    The LIKE predicate is sensitive to diacritical markings used
    in any Multinational Character Set. Therefore, a matches a, but
    neither matches á, à, ä, Á, À, Â and so on.

    In Spanish, ch and ll are treated as if they are unique single
    letters. For example, if a domain is defined with the collating
    sequence SPANISH, then LIKE "c%" will not retrieve the word char
    but will retrieve the word cat.

    The LIKE predicate has this form:

  like-predicate =

  ---> value-expr  -+------+-> LIKE -----> <pattern> +
                    +> NOT +                         |
        +--------------------------------------------+
        +-+-+------------------------------+-+--->
          | +-> ESCAPE <escape-character> -+ |
          | +-> IGNORE CASE ---------------+ |
          +----------------<-----------------+

  pattern =

  ----> char-value-expr ---->

  escape-character =

  ----> char-value-expr ------------>

    SQL interprets the value-expr argument as a character string
    and compares it to the pattern. The pattern must be a value
    expression with a text data type.

    Within the pattern, the percent sign (%),  underscore (_), and
    escape characters have special meaning.

    o  The percent sign represents any string of characters,
       including no characters at all. The percent sign is a wildcard
       character.

    o  The underscore represents any single character.

    o  An escape character causes SQL to interpret a wildcard
       character as itself to search for character strings containing
       the wildcard character. The value of the escape character must
       be 1 character in length.

       The following table explains the valid sequences allowed for
       escape characters.

    Table 7 Escape Character Sequences

    Character in Pattern   Character Matched

    %                      any string
    _                      any character
    escape-character %     %
    escape-character _     _
    escape-character       escape-character
    escape-character

       You can only specify the percent sign, underscore, or the
       escape-character itself. Any other character is invalid and an
       error is returned.

    All other characters represent themselves.
Close Help