Progress
SQL-92
Guide and Reference
GRANT Statement
Grants various privileges to the specified users of the database. There are two forms of the GRANT statement:
- Grant database_wide privileges, either system administration (DBA) or general creation (RESOURCE), or both.
- Grant various privileges on specific tables and views. Privilege definitions are stored in the system tables SYSDBAUTH, SYSTABAUTH, and SYSCOLAUTH for the database, tables, and columns, respectively.
This is the syntax to GRANT database-wide privileges:
SYNTAX
This is syntax to GRANT privileges on specific tables and views:
SYNTAX
privilege
:
RESOURCE
Allows the specified users to issue
CREATE
statements.DBA
Allows the specified users to create, access, modify, or delete any database object, and to grant other users any privileges.
TO username [ , username ] , ...
Grants the specified privileges on the table or view to the specified list of users.
SELECT
Allows the specified users to read data from the table or view.
INSERT
Allows the specified users to add new rows to the table or view.
DELETE
Allows the specified users to delete rows from the table or view.
INDEX
Allows the specified users to create an index on the table or view.
UPDATE [ ( column , column , ... ) ]
Allows the specified users to modify existing rows in the table or view. If followed by a column list, the users can modify values only in the columns named.
REFERENCES [ ( column , column , ... ) ]
Allows the specified users to refer to the table from other tables' constraint definitions. If followed by a column list, constraint definitions can refer only to the columns named. For more detail on constraint definitions, see the Column Constraints and Table Constraints section.
ALL
Grants all privileges for the table or view.
TO PUBLIC
Grants the specified privileges on the table or view to any user with access to the system.
WITH GRANT OPTION
Allows the specified users to grant their privileges or a subset of their privileges to other users.
EXAMPLE
NOTE: If the username specified in a RESOURCE or DBA GRANT operation does not already exist, the GRANT statement creates a row in the SYSDBAUTH system table for the new username. This row is not deleted by a subsequent REVOKE operation.AUTHORIZATION
Must have the DBA privilege, ownership of the table, or all the specified privileges on the table (granted with the WITH GRANT OPTION clause).
SQL COMPLIANCE
SQL-92, ODBC Core SQL grammar. Extensions: INDEX, RESOURCE, DBA privileges
ENVIRONMENT
Embedded SQL, interactive SQL, ODBC applications, JDBC applications
RELATED STATEMENTS
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |