GRANT (Object Privileges) command

This command gives users database object privileges.

Syntax

GRANT privilege., ..ON object_name
    TO { grantee., ...} | PUBLIC
    [ WITH GRANT OPTION ];
privilege ::= 
     { ALL PRIVILEGES }
     | { SELECT
         | DELETE
         | { INSERT [ ( column name.,..) ] }
         | { UPDATE [ ( column name.,..) ] }
         
object name ::=
         [ TABLE ] table name
Keyword Description
privilege Type of access, action, or privilege to grant:
  • ALL PRIVILEGES - Passes on all applicable privileges that you are entitled to grant. PUBLIC denotes all authorization IDs, present and future
  • SELECT, INSERT, UPDATE, and DELETE - Let grantees execute the statements of the same names on the object
object_name Name of the object on which to grant privileges
grantee User name(s) to allow privilege

Use

This statement gives grantees the right to perform specified actions on named objects. (Grantee is the authorization ID that represents a user or group of users.)