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)
- DB2Connection.setDB2ClientUser(String info)
- 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.
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.
In a distributed environment, if the value set by the API exceeds 16 bytes, it is truncated to 16 bytes.
SELECT DEPT
FROM DEPT_USERID_MAP
WHERE USER_ID = CURRENT CLIENT_USERID