CURRENT CLIENT_USERID

CURRENT CLIENT_USERID contains the value of the client user ID from the client information that is specified for the connection.

The default client user ID is the primary authorization ID used to establish the connection.

The data type is VARCHAR(255).

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

  • SQLE_CLIENT_INFO_USERID (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 user ID is explicitly set, it overwrites the primary authorization id described above and is used as the client user ID.

Start of changeIf the value set by the API exceeds 128 bytes, it is truncated to 128 bytes.End of change

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

Example

Find out in which department the current client user ID works.
  SELECT DEPT
    FROM DEPT_USERID_MAP
    WHERE USER_ID = CURRENT CLIENT_USERID