Pattern Value Arguments
The search pattern characters are:
The escape character is retrieved with the SQL_SEARCH_PATTERN_ESCAPE option in SQLGetInfo. It must precede any underscore, percent sign, or escape character in an
argument that accepts search patterns to include that character as a literal. For
example:
An underscore (_), which represents any single character.
A percent sign (%), which represents any sequence of zero or more characters.
An escape character, which is driver-specific and is used to include
underscores, percent signs, and the escape character as literals.
Search pattern
| Description
|
%A% | All identifiers containing the letter A
|
ABC_
| All four character identifiers starting with ABC
|
ABC\_
| The identifier ABC_, assuming the escape character is a backslash (\)
|
\\%
| All identifiers starting with a backslash (\), assuming the escape character
is a backslash
|
Note ODBC 2.x drivers do not support search patterns in the CatalogName argument in SQLTables. ODBC 3.0 drivers accept search patterns in this argument if the SQL_ATTR_ ODBC_VERSION environment attribute is set to SQL_OV_ODBC3; they do not accept search patterns in this argument if it is set to SQL_OV_ODBC2.
Passing a null pointer to a search pattern argument does not constrain the search for that argument; that is, a null pointer and the search pattern % (any characters) are equivalent. However, a zero-length search pattern
—that is, a valid pointer to a string of length zero—matches only the empty string (“”).