The ALL keyword grants all possible table-level privileges to the specified user. If any or all of the table-level privileges do not exist for the grantor, the GRANT statement with the ALL keyword succeeds (in the sense of SQLCODE being set to zero, even if the possible privileges are an empty set for the grantor on the table). In this case, however, the following SQLSTATE warning is returned:
01007 - Privilege not granted.
For example, assume that user ted has the Select and Insert privileges on the customer table with the authority to grant those privileges to other users.
User ted wants to grant all table-level privileges to user tania. So user ted issues the following GRANT statement:
GRANT ALL ON customer TO tania;
This statement executes successfully but returns SQLSTATE code 01007 for the following reasons:
With Dynamic Server, if you grant all table-level privileges with the ALL keyword, the privileges includes the Under privilege only if the table is a typed table. The grant of ALL privileges does not include the Under privilege if the table is not based on a ROW type.
If the table owner grants ALL privileges on a traditional relational table and later changes that table to a typed table, the table owner must explicitly grant the Under privilege to allow other users to create subtables under it.
You grant table-level privileges directly by specifying the name or an existing synonym of a table or of a view, which you can qualify with the owner name.
Table Reference: |--+-----------+--+-view----+-----------------------------------| '-owner-- .-' +-table---+ '-synonym-'
Element | Description | Restrictions | Syntax |
---|---|---|---|
owner | Name of the user who owns the table, view, or synonym | Must be a valid authorization identifier | Owner Name,
p. Owner Name |
synonym,
table, view |
Synonym, table, or view on which privileges are granted | The table, view, or synonym must exist in the database | Database Object Name, p. Database Object Name |
The object on which you grant privileges must reside in the current database.
In an ANSI-compliant database, if owner is not enclosed between quotation marks, the database stores the owner name in lowercase letters.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]