Vendor escape clauses

Vendor escape clauses increase the portability of your application if your application accesses multiple data sources from different vendors. However, if your application accesses only Db2 data sources, you have no reason to use vendor escape clauses.

The X/Open SQL CAE specification defines an escape clause as: “a syntactic mechanism for vendor-specific SQL extensions to be implemented in the framework of standardized SQL.” Both Db2 ODBC and ODBC support vendor escape clauses that conform to this X/Open specification.

Data sources are not necessarily consistent in how they implement SQL extensions. Use vendor escape clauses to implement common SQL extensions in a consistent, portable format.

Db2 ODBC translates the SQL extensions that ODBC defines to native Db2 SQL syntax. To display the Db2-specific syntax that results from this translation, call SQLNativeSql() on an SQL string that contains ODBC vendor escape clauses.