DB2 10.5 for Linux, UNIX, and Windows

ClientWrkStnName CLI/ODBC configuration keyword

Use the ClientWrkStnName keyword to set the client workstation name that is sent to a database.

db2cli.ini keyword syntax:
ClientWrkStnName = workstation name
Default setting:
If the ClientWrkStnName keyword is not specified, a default value that consists of the host name is used. The host name is obtained by calling the gethostname() function. If the host name is not configured or an error is encountered during the gethostname() function call, no value for the ClientWrkStnName keyword is sent to the server.
Applicable when:
Connected to a database with an IBM® Data Server product.
Equivalent environment or connection attribute:
SQL_ATTR_INFO_WRKSTNNAME
Usage notes:
 The CLI driver has a limit of 255 characters for the ClientWrkStnName keyword.
Database servers enforce different limitations in the length of the value and can truncate it. Note the following conditions:
  • DB2® for z/OS® Version 11 servers in new function mode (NFM) support a length of up to 255 characters for the CURRENT CLIENT_WRKSTNNAME special register.
  • DB2 for z/OS servers remove trailing spaces that are specified in the ClientWrkStnName keyword value.
  • DB2 for z/OS Version 10 and earlier servers support a length of up to 18 characters.
  • CLI applications can set the ClientWrkStnName keyword on DB2 for i V6R1 and later servers. DB2 for i servers support a length of up to 255 characters.
To ensure that the data is converted correctly when transmitted to DB2 for z/OS Version 9 and earlier servers, use only the characters A-Z and 0-9 and the underscore (_) or period (.).
If you do not want to specify a value for the ClientWrkStnName keyword, specify the 'NODEFAULT' value. The 'NODEFAULT' value means that no value is sent to the server.
ClientWrkStnName='NODEFAULT'

For connection to DB2 for z/OS servers, the ClientWrkStnName keyword is replayed upon connection failover when the automatic client reroute (ACR) feature and the workload balance (WLB) feature are enabled.

A client sends the default client information register values to the DB2 for z/OS server when they are not explicitly set by the user. The default CURRENT CLIENT_WRKSTNNAME special register value is the hostname of the client. The SQLGetConnectAttr() function and the sqleqryi API can return the default value only when the enableDefaultClientInfo keyword is set to True in the IBM data server driver configuration file.