In version 15.7 ESD #7, Adaptive Server ODBC Driver adds support for setting client connection attributes efficiently using the ODBC SQLSetConnectAttr API. The attribute values set are visible in the Adaptive Server sysprocesses table and help distinguish different client connections.
To set these attributes in versions earlier than 15.7 ESD #7, application programs had to explicitly call set statements to set corresponding attributes resulting in additional executions on the server. When the SQLSetConnectAttr API is used, the driver defers executing the set statements, attaching them to the next statement that is executed.
Since the set statements are not
executed immediately after SQLSetConnectAttr API
is called, the values set are invisible on Adaptive Server until
the next statement is executed.
SQLSetConnectAttr supports these attributes:
SQL_ATTR_CLIENT_NAME – sets the client name, using the command set clientname <value>.
SQL_ATTR_CLIENT_HOST_NAME – sets the client host name, using the command set clienthostname <value>.
SQL_ATTR_CLIENT_APPL_NAME – sets the client application name, using the command set clientapplname <value>.
The value of these attributes is truncated to 30 bytes.Use the ODBC SQLGetConnectAttr to retrieve the value of these attributes. However, it does not reflect any changes to the server value made outside of this interface.