GRANT (XSR object privileges) statement
This form of the GRANT statement grants USAGE privilege on an XSR object.
Invocation
The GRANT statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared only if the DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).
Authorization
One of the following authorities
is required:
- ACCESSCTRL or SECADM authority
- ACCESSCTRL authority on the schema containing the XSR object
- Owner of the XSR object, as recorded in the OWNER column of the SYSCAT.XSROBJECTS catalog view
Syntax
Description
- ON XSROBJECT xsrobject-name
- This name identifies the XSR object for which the USAGE privilege is granted. The xsrobject-name, including the implicit or explicit schema qualifier, must uniquely identify an existing XSR object at the current server. If no XSR object by this name exists, an error is returned (SQLSTATE 42704).
- TO PUBLIC
- Grants the USAGE privilege to a set of users (authorization IDs).
Example
Grant every user the usage privilege
on the XML schema MYSCHEMA:
GRANT USAGE ON XSROBJECT MYSCHEMA TO PUBLIC