Escape Sequences in ODBC
The escape sequence used by ODBC is as follows:{extension}
The escape sequence is recognized and parsed by drivers, which replace the
escape sequences with DBMS-specific grammar. For more information about escape
sequence syntax, see Appendix C, “SQL Grammar.”
Note In ODBC 2.x, the standard syntax of the escape sequence was:
--(*vendor(vendor-name), product(product-name) extension *)--
In addition to this syntax, a shorthand syntax was defined of the form: {extension}. In ODBC 3.0, the long form of the escape sequence has been deprecated, and
the shorthand form is used exclusively.
Because the escape sequences are mapped by the driver to DBMS-specific
syntaxes, an application can use either the escape sequence or DBMS-specific syntax.
However, applications that use the DBMS-specific syntax will not be
interoperable. When using the escape sequence, applications should make sure that the
SQL_ATTR_NOSCAN statement attribute is turned off, which it is by default.
Otherwise, the escape sequence will be sent directly to the data source, where it will
generally cause a syntax error.
Drivers only support those escape sequences that they can map to underlying
language features. For example, if the data source does not support outer joins,
neither will the driver. To determine which escape sequences are supported, an
application calls SQLGetTypeInfo and SQLGetInfo. For more information, see the next section, “Date, Time, and Timestamp Literals.”
Date, time, timestamp, and datetime interval literals
Scalar functions such as numeric, string, and data type conversion functions
LIKE predicate escape character
Outer joins
Procedure calls