DB2 10.5 for Linux, UNIX, and Windows

REVOKE (role) statement

This form of the REVOKE statement revokes roles from users, groups, or other roles.

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 at least one of the following authorities:
  • The WITH ADMIN OPTION on the role
  • SECADM authority
SECADM authority is required to revoke the ADMIN OPTION FOR role-name from an authorization-name or to revoke a role-name from an authorization-name that has the WITH ADMIN OPTION on that role.

Syntax

Read syntax diagramSkip visual syntax diagram
                                           .-,---------.   
                                 .-ROLE-.  V           |   
>>-REVOKE--+------------------+--+------+----role-name-+-------->
           '-ADMIN OPTION FOR-'                            

         .-,---------------------------------.               
         V                                   |  .-BY ALL-.   
>--FROM----+-+-------+--authorization-name-+-+--+--------+-----><
           | +-USER--+                     |                 
           | +-GROUP-+                     |                 
           | '-ROLE--'                     |                 
           '-PUBLIC------------------------'                 

Description

ADMIN OPTION FOR
Revokes the WITH ADMIN OPTION on role-name. The WITH ADMIN OPTION on role-name must be held by authorization-name or by PUBLIC, if PUBLIC is specified (SQLSTATE 42504). If the ADMIN OPTION FOR clause is specified, only the WITH ADMIN OPTION on ROLE role-name is revoked, not the role itself.
ROLE role-name
Specifies the role that is to be revoked. The role-name must identify an existing role at the current server (SQLSTATE 42704) that has been granted to authorization-name or to PUBLIC, if PUBLIC is specified (SQLSTATE 42504).
FROM
Specifies from whom the role is revoked.
USER
Specifies that the authorization-name identifies a user.
GROUP
Specifies that the authorization-name identifies a group.
ROLE
Specifies that the authorization-name identifies an existing role at the current server (SQLSTATE 42704).
authorization-name,...
Lists the authorization IDs of one or more users, groups, or roles. The list of authorization IDs cannot include the authorization ID of the user issuing the statement (SQLSTATE 42502).
PUBLIC
Revokes the specified roles from PUBLIC.
BY ALL
Revokes the role-name from each specified authorization-name that was explicitly granted that role, regardless of who granted it. This is the default behavior.

Rules

Notes

Examples