Assigns authorizations to users.
To grant authorization to access database objects:
grant {all [privileges]| permission_list} on {table_name | view_name} | stored_procedure_name} to {public | name_list} with grant option]
To grant authorization to create database objects:
grant {all [privileges] | command_list} to {public | name_list}
Any valid object in the catalog can be substituted for table_name or view_name.
when used to assign authorization to access database objects (first syntax format), all specifies that all privileges applicable to the specified object are granted or revoked.
is a list of authorizations granted.
is a list of commands granted.
is the name of a table in the database.
is the name of a view in the current database. Only one view can be listed for each grant command.
is the name of a stored procedure in the database.
is all users of the “public” group, which includes all users of the system.
is a list of users’ database names or group names or both, separated by commas.
allows the users specified in name_list to grant the privileges specified by permission_list to other users.
grant insert, delete on titles to mary, sales
grant update on titles (price, advance) to public
grant create database, create table to mary, john
grant all on titles to public
grant all to public
grant update on authors to mary with grant option
grant select, update on titles(price) to bob with grant option
DB2 does not allow you to grant authorization to a stored procedure.
You can substitute the word from for to in the grant syntax.
You can only grant or revoke authorizations on objects in the current database.
Role_name, which allows you to grant authorizations to all users who have been granted a specific role, is not supported. However, if you include it in the command, an error does not occur.
Copyright © 2005. Sybase Inc. All rights reserved. |