DB2 Version 9.7 for Linux, UNIX, and Windows

OleDbSQLColumnsSortByOrdinal CLI/ODBC configuration keyword

Makes OLE DB's IDBSchemaRowset::GetRowset(DBSCHEMA_COLUMNS) return a row set sorted by the ORDINAL_POSITION column.

db2cli.ini keyword syntax:
OleDbSQLColumnsSortByOrdinal = 0 | 1
Equivalent connection attribute:
SQL_ATTR_SQLCOLUMNS_SORT_BY_ORDINAL_OLEDB
Default setting:
IDBSchemaRowset::GetRowset(DBSCHEMA_COLUMNS) returns the row set sorted by the columns TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME.
Usage notes:
The Microsoft OLE DB specification requires that IDBSchemaRowset::GetRowset(DBSCHEMA_COLUMNS) returns the row set sorted by the columns TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME. The IBM® DB2® OLE DB Provider conforms to the specification. However, applications that use the Microsoft ODBC Bridge provider (MSDASQL) have been typically coded to get the row set sorted by ORDINAL_POSITION. Setting the OleDbSQLColumnsSortByOrdinal keyword to 1 will make the provider return a row set sorted by ORDINAL_POSITION.
The OleDbSQLColumnsSortByOrdinal keyword is supported by the following database servers:
  • DB2 for z/OS®
    • Version 8 with PTF UQ93890
    • Versions later than version 8, PTFs are not required
  • DB2 for Linux, UNIX, and Windows
    • Version 8.2 (equivalent to Version 8.1, FixPak 7) and later