Previous Topic

Next Topic

Grant (privilege)

Valid in: SQL, ESQL

The Grant (privilege) statement grants privileges on the database as a whole or on individual tables, views, sequences or procedures. It controls access to database objects, roles, and DBMS resources. Details about using the grant statement with role objects is described in Grant (role).

To remove privileges, use the revoke statement. To determine the privileges in effect for a session, use the dbmsinfo function. In some cases granting a privilege imposes a restriction, and revoking the privilege removes the restriction. For example, grant nocreate_table prevents the user from creating tables.

Note: The grant statement is the ISO/ANSI-compliant method for controlling access to database objects and resources.

To display granted database privileges, select data from the iidbprivileges system catalog. For details about system catalogs, see the Database Administrator Guide.

Previous Topic

Next Topic

Syntax

The Grant (privilege) statement has the following format:

[EXEC SQL] GRANT ALL [PRIVILEGES] | privilege {, privilege}
              [ON [object_descriptor] [schema.]object_name
{, [schema.]object_name}]
              TO PUBLIC | [auth_type] auth_id {, auth_id} [WITH GRANT OPTION];


© 2007 Ingres Corporation. All rights reserved.