SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)

Creating an SQL/MX Database
HP NonStop SQL/MX Installation and Management Guide523723-004
7-10
Granting and Revoking Access Privileges to
SQL/MX Database Objects
Granting and Revoking Access Privileges to SQL/MX Database
Objects
Use the GRANT statement to grant access privileges to one or more users for an
SQL/MX table or view. You identify users with authorization IDs, which are valid
Guardian user names enclosed in double quotes. You grant privileges to perform
specific statements (SELECT, DELETE, INSERT, UPDATE), to create referential
constraints (REFERENCES), or to perform all privileges that apply to the object type.
Use the WITH GRANT OPTION to specify that users to which privileges are granted
are authorized to grant the same privileges to other authorization IDs.
To grant a privilege on an SQL/MX table or view, you must have that privilege and also
have the right to grant that privilege. That is, the privilege must be issued to you
through the WITH GRANT OPTION and not have been revoked.
Granting privileges on a view does not grant that privilege to the corresponding column
of the underlying table.
For more information about the GRANT and GRANT EXECUTE statements, see the
SQL/MX Reference Manual.
Examples for Granting Privileges
This example grants SELECT privileges on a table, but not the privilege of granting
SELECT privileges to others:
GRANT SELECT ON TABLE persnl.employee TO “sql.user1”;
This example grants SELECT and DELETE privileges on a table, including the
privilege of granting SELECT and DELETE privileges to others:
GRANT SELECT, DELETE ON TABLE sales.odetail
TO “sql.user1”, “sql.user2” WITH GRANT OPTION;
This example grants UPDATE privileges on the named columns to PUBLIC:
GRANT UPDATE (start_date, ship_timestamp)
ON TABLE persnl.project to PUBLIC;
Revoking Access Privileges
Use the REVOKE statement to revoke access privileges for an SQL/MX table or view
from specified users. For more information, see the SQL/MX Reference Manual.
Access Privileges for SQL/MX Utilities
For information about the minimum user privileges required to access the SQL/MX
utilities, see the SQL/MX Reference Manual.