SQL Reference
This form of the GRANT statement grants the CONTROL privilege on
indexes.
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:
- DBADM authority
- SYSADM authority.
Syntax
>>-GRANT--CONTROL--ON INDEX--index-name------------------------->
.-,------------------------------------.
V |
>----TO----+-+-------+---authorization-name--+--+--------------><
| +-USER--+ |
| '-GROUP-' |
'-PUBLIC--------------------------'
Description
- CONTROL
- Grants the privilege to drop the index. This is the CONTROL
authority for indexes, which is automatically granted to creators of
indexes.
- ON INDEX index-name
- Identifies the index for which the CONTROL privilege is to be
granted.
- TO
- Specifies to whom the privileges are granted.
- USER
- Specifies that the authorization-name identifies a user.
- GROUP
- Specifies that the authorization-name identifies a group
name.
- 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. (It is not possible to grant authorities to
an authorization-name that is the same as the authorization ID of the
GRANT statement.)
- PUBLIC
- Grants the privileges to all users.
Rules
- If neither USER nor GROUP is specified, then
- If the authorization-name is defined in the operating system only as
GROUP, then GROUP is assumed.
- If the authorization-name is defined in the operating system only as USER
or if it is undefined, USER is assumed.
- If the authorization-name is defined in the operating system as both, or
DCE authentication is used, an error (SQLSTATE 56092) is raised.
Example
GRANT CONTROL ON INDEX DEPTIDX TO USER USER4
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]