CURRENT CLIENT_USERID special register
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)
- SQLSetConnectAttr (ODBC)
- java.sql.Connection.setClientInfo (JDBC)
- 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 the value set by the API exceeds 128 bytes, it is truncated to 128 bytes.
The application compatibility value of the package determines the length and blank padding of the CURRENT CLIENT_USERID special register returned.
Monitoring remote user statistics based on CURRENT CLIENT_USERID (IFCID 412)
You can start a trace that includes statistics class 11 (IFCID 412) to monitor statistics for remote DRDA users based on the CURRENT CLIENT_USERID special register. For more information, see Statistics trace.
Example
SELECT DEPT
FROM DEPT_USERID_MAP
WHERE USER_ID = CURRENT CLIENT_USERID