GRANT Statement

Gives privileges for a particular SQL table to users.

Syntax

GRANT [ ALL || grant-privilege {, grant-privilege{...}} ] ON table-name TO [ PUBLIC || user-name {, user-name{...}} ]

Syntax Elements

grant-privilege =
DELETE || INSERT || SELECT || UPDATE

table-name =
{owner-name.}table-identifier

owner-name
The SQL user-id of the creator of the table.

table-identifier
The name of the required table.

user-name
The SQL user-id of the user to be granted access.

Restrictions

Comments

Privileges granted to PUBLIC are available to all users.

The INSERT, UPDATE and DELETE privileges on a particular table can be overridden for all users by clearing the table's "update permission" flag in SQLM.

Examples

GRANT SELECT ON EMP TO PUBLIC 
GRANT ALL ON EMP TO admin