The following types of permissions can be granted:
Before you issue a GRANT statement, check that the
You can grant privileges to database objects that you are authorized to grant. See the CREATE statement for the database object that you want to grant privileges on for more information.
The syntax that you use for the GRANT statement depends on whether you are granting privileges to a table or to a routine, or granting a role.
For more information on using the GRANT statement, see "Using SQL standard
authorization" in the
Before you can grant a role to a user or to another role, you must create the
role using the
A role A contains another role B if role B is granted to role A, or is contained in a role C granted to role A. Privileges granted to a contained role are inherited by the containing roles. So the set of privileges identified by role A is the union of the privileges granted to role A and the privileges granted to any contained roles of role A.
Use the ALL PRIVILEGES privilege type to grant all of the permissions to the user or role for the specified table. You can also grant one or more table privileges by specifying a privilege-list.
Use the DELETE privilege type to grant permission to delete rows from the specified table.
Use the INSERT privilege type to grant permission to insert rows into the specified table.
Use the REFERENCES privilege type to grant permission to create a foreign key reference to the specified table. If a column list is specified with the REFERENCES privilege, the permission is valid on only the foreign key reference to the specified columns.
Use the SELECT privilege type to grant permission to perform SELECT statements on a table or view. If a column list is specified with the SELECT privilege, the permission is valid on only those columns. If no column list is specified, then the privilege is valid on all of the columns in the table.
Use the TRIGGER privilege type to grant permission to create a trigger on the specified table.
Use the UPDATE privilege type to grant permission to use the UPDATE statement on the specified table. If a column list is specified, the permission applies only to the specified columns. To update a row using a statement that includes a WHERE clause, you must have SELECT permission on the columns in the row that you want to update.
You can grant privileges or roles to specific users or roles or to all users.
Use the keyword PUBLIC to specify all users. When PUBLIC is specified, the
privileges or roles affect all current and future users. The privileges granted
to PUBLIC and to individual users or roles are independent privileges. For
example, a SELECT privilege on table
Either the object owner or the database owner can grant privileges to a user or to a role. Only the database owner can grant a role to a user or to another role.
To grant the SELECT
privilege on table
To
grant the UPDATE and TRIGGER privileges on table
To
grant the SELECT privilege on table
To grant the EXECUTE privilege on procedure
To grant the role
To grant the SELECT privilege on table