Status of this Function since DB2 CLI Version 5
Note: |
In ODBC version 3, SQLSetConnectOption() has been deprecated and replaced with SQLSetConnectAttr(); see SQLSetConnectAttr - Set Connection Attributes for more information. Although this version of DB2 CLI continues to support SQLSetConnectOption(), we recommend that you begin using SQLSetConnectAttr() in your DB2 CLI programs so that they conform to the latest standards. See DB2 CLI Functions Deprecated for Version 5 for more information on this and other deprecated functions. |
Note: | This deprecated function cannot be used in a 64-bit environment. For more details see Deprecated Functions Not Supported in a 64-bit Environment. |
Migrating to the New Function
The statement:
SQLSetConnectOption( *hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
for example, would be rewritten using the new function as:
SQLSetConnectAttr( *hdbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, 0);
In versions of DB2 before DB2 Universal Database version 5, SQLSetConnectOption() could be used to set certain statement attributes as well as connection attributes. This behavior has since been removed; SQLSetConnectAttr() cannot be used to set statement attributes. See Setting a Subset of Statement Attributes using SQLSetConnectAttr() for complete details on migrating a version 2 application that made use of this feature.