DB2 10.5 for Linux, UNIX, and Windows

GRANT (SETSESSIONUSER privilege) statement

This form of the GRANT statement grants the SETSESSIONUSER privilege to one or more authorization IDs. The privilege allows the holder to use the SET SESSION AUTHORIZATION statement to set the session authorization to one of a set of specified authorization IDs.

Invocation

This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).

Authorization

The privileges held by the authorization ID of the statement must include SECADM authority.

Syntax

Read syntax diagramSkip visual syntax diagram
                            .-,------------------------------------.       
                            V                                      |       
>>-GRANT SETSESSIONUSER ON----+-USER--session-authorization-name-+-+--TO-->
                              '-PUBLIC---------------------------'         

   .-,-----------------------------.   
   V                               |   
>----+-USER--+--authorization-name-+---------------------------><
     '-GROUP-'                         

Description

SETSESSIONUSER ON
Grants the privilege to assume the identity of a new authorization ID.
USER session-authorization-name
Specifies the authorization ID that the authorization-name will be able to assume, using the SET SESSION AUTHORIZATION statement. The session-authorization-name must identify a user, not a group.
PUBLIC
Specifies that the grantee will be able to assume any valid authorization ID, using the SET SESSION AUTHORIZATION statement.
TO
Specifies to whom the privilege is granted.
USER
Specifies that the authorization-name identifies a user.
GROUP
Specifies that the authorization-name identifies a group.
authorization-name,...
Lists the authorization IDs of one or more users or groups.

The list of authorization IDs cannot include the authorization ID of the user issuing the statement (SQLSTATE 42502).

Rules

Notes

Examples