This form of the REVOKE statement revokes authorities that apply to the entire database.
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. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).
Authorization
The privileges held by the authorization ID of the statement must include at least one of the following:
To revoke DBADM authority, SYSADM authority is required.
Syntax
.-,----------------------. V | >>-REVOKE------+-BINDADD-----------+--+--ON DATABASE------------> +-CONNECT-----------+ +-CREATETAB---------+ +-CREATE_NOT_FENCED-+ +-IMPLICIT_SCHEMA---+ '-DBADM-------------' .-,------------------------------------. V | >----FROM----+-+-------+---authorization-name--+--+------------>< | +-USER--+ | | '-GROUP-' | '-PUBLIC--------------------------'
Description
The BINDADD authority cannot be revoked from an authorization-name holding DBADM authority without also revoking the DBADM authority.
Revoking the CONNECT authority from a user does not affect any privileges that were granted to that user on objects in the database. If the user is subsequently granted the CONNECT authority again, all previously held privileges are still valid (assuming they were not explicitly revoked).
The CONNECT authority cannot be revoked from an authorization-name holding DBADM authority without also revoking the DBADM authority (SQLSTATE 42504).
The CREATETAB authority cannot be revoked from an authorization-name holding DBADM authority without also revoking the DBADM authority (SQLSTATE 42504).
The CREATE_NOT_FENCED authority cannot be revoked from an authorization-name holding DBADM authority without also revoking the DBADM authority (SQLSTATE 42504).
DBADM authority cannot be revoked from PUBLIC (because it cannot be granted to PUBLIC).
Revoking DBADM authority does not automatically revoke any privileges that were held by the authorization-name on objects in the database, nor does it revoke BINDADD, CONNECT, CREATETAB, IMPLICIT_SCHEMA, or CREATE_NOT_FENCED authority.
The authorization ID of the REVOKE statement itself cannot be used. (It is not possible to revoke the authorities from an authorization-name that is the same as the authorization ID of the REVOKE statement.)
Rules
Examples
Example 1: Given that USER6 is only a user and not a group, revoke the privilege to create tables from the user USER6.
REVOKE CREATETAB ON DATABASE FROM USER6
Example 2: Revoke BINDADD authority on the database from a group named D024. There are two rows in the SYSCAT.DBAUTH catalog view for this grantee; one with a GRANTEETYPE of U and one with a GRANTEETYPE of G.
REVOKE BINDADD ON DATABASE FROM GROUP D024
In this case, the GROUP keyword must be specified; otherwise an error will occur (SQLSTATE 56092).