SQL/MX 3.1 Installation and Management Guide (H06.23+, J06.12+)

Creating an SQL/MX Database
HP NonStop SQL/MX Release 3.1 Installation and Management Guide663852-001
7-11
Examples for Granting Privileges
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.
Creating SQL/MX Tables
Tables are the foundation of an SQL/MX database. All data physically resides in tables.
When you create a table with the CREATE TABLE statement, you specify the definition
of each data column and the attributes of the physical file in which the table is to be
stored. Carefully consider the file attributes to ensure that the table meets the needs of
your application.
The CREATE TABLE statement stores the table definition in the definition schema of
the table’s catalog and creates the table, which physically exists as one or more disk
files.
All Guardian files underlying SQL/MX objects use the key-sequenced file organization
with format 2. You cannot use entry-sequenced or relative organizations with SQL/MX
tables. Before creating an SQL/MX table, you should understand the key-sequenced
type of table organizations and column, key, and index design considerations. For
more information, see Section 4, Understanding and Planning SQL/MX Tables.
Note. To create SQL/MX tables and build an SQL/MX database, you must purchase and install
the SQL/MX DDL License product on your system. See Section 2, Preparing to Install NonStop
SQL/MX, for more information about this license.