CURRENT CLIENT_APPLNAME

CURRENT CLIENT_APPLNAME contains the value of the application name from the client information that is specified for the connection.

The data type is VARCHAR(255).

Start of changeThe default application name varies, depending on the connection:End of change

  • If the connection is from a remote application client driver, the default is the application name as supplied by the driver. Default values set by the IBM® Data Server Driver for JDBC and SQLJ can be obtained from the DatabaseMetaData.getClientInfoProperties method.
  • If the connection is from a remote Db2 11 for z/OS® application, the default varies depending on which attachment facility is used:
    TSO attachment facility
    The default application name is one of the following cases:
    • The TSO logon user ID when the application runs in TSO foreground using TSO online applications like SPUFI.
    • The job name when the application runs in TSO background using TSO batch applications like DSNTEP2.
    RRS attachment facility interface
    The correlation ID that is provided at the call of the RRS DSNRLI SIGNON function.
    Call attachment facility
    The job name.
    CICS® attachment facility
    The first 8 bytes of the correlation ID. In particular the correlation ID is a 12-byte string for a CICS transaction, where the first 8 bytes are used as the default application name.
    IMS Attachment facility
    An 8-byte string, the Program Specification Block (PSB) name, or the program name.

The value of the special register can be changed by using one of the following application programming interfaces (APIs):

  • SQLE_CLIENT_INFO_APPLNAME (sqleseti)
  • Start of changeSQLSetConnectAttr (ODBC) End of change
  • Start of changejava.sql.Connection.setClientInfo (JDBC)End of change
  • The RRS DSNRLI SIGNON, AUTH SIGNON, CONTEXT SIGNON, or SET_CLIENT_ID function
  • The WLM_SET_CLIENT_INFO stored procedure

When the client application name is explicitly set, it overwrites the default application name described above and is used as the client application name.

Start of changeThe application compatibility value of the package determines the length and blank padding of the CURRENT CLIENT_APPLNAME special register returned.End of change

If one of these APIs is not used to set the value of the special register, an empty string is returned when the special register is referenced.

Example: Select the departments that are allowed to use the application that is being used in this connection.
  SELECT DEPT
    FROM DEPT_APPL_MAP
    WHERE APPL_NAME = CURRENT CLIENT_APPLNAME