CURRENT SQLID

CURRENT SQLID specifies the SQL authorization ID of the process.

The data type is VARCHAR(128).

The SQL authorization ID is:

  • The authorization ID used for authorization checking on dynamically prepared CREATE, GRANT, and REVOKE SQL statements.
  • The owner of a table space, database, storage group, or synonym created by a dynamically issued CREATE statement.

The initial value of CURRENT SQLID can be provided by the connection or sign-on exit routine. If not, the initial value is the primary authorization ID of the process. The value remains in effect until one of the following events occurs:

  • The SQL authorization ID is changed by the execution of a SET CURRENT SQLID statement.
  • A SIGNON or re-SIGNON request is received from a CICS® transaction subtask or an IMS™ independent region.
  • The DB2® connection is ended.
  • Start of changeWhen running in a trusted connection, the user is switched.End of change

The initial value of CURRENT SQLID in a user-defined function or stored procedure is inherited according to the rules in Table 1.

CURRENT SQLID can only be referred to in an SQL statement that is executed by the current server.

CURRENT SQLID cannot be a role.

Example: Set the SQL authorization ID to 'GROUP34' (one of the authorization IDs of the process).
  SET CURRENT SQLID = 'GROUP34';