SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-142
Considerations for GRANT EXECUTE
SYSTEM specifies the implicit grantor of privileges to the creators of stored
procedures.
You cannot specify SYSTEM as an authid in a GRANT EXECUTE statement.
WITH GRANT OPTION
specifies that users of the authorization IDs to whom the EXECUTE privilege is
granted have the right to grant EXECUTE privilege to other authorization IDs.
BY authid-grantor
specifies the authorization ID authid-grantor on whose behalf the grant
operation is performed. Only the super ID can use the BY clause. If another user
attempts to do so, the system returns an error. The effect of using the BY clause is
the same as if the authid-grantor were to issue the GRANT EXECUTE
statement directly (without using the BY clause).
authid-grantor must be a valid authorization ID and cannot be SYSTEM.
Considerations for GRANT EXECUTE
Authorization and Availability Requirements
To grant EXECUTE privilege on a stored procedure, you must have both that privilege
and the right to grant that privilege. The owner, or creator, of the stored procedure and
the super ID automatically have EXECUTE and WITH GRANT OPTION privileges on a
stored procedure. All other users must be granted both EXECUTE and WITH GRANT
OPTION privileges to grant other users the EXECUTE privilege. If you lack authority to
grant the EXECUTE privilege, the system returns an error.
If the super ID issues a GRANT EXECUTE statement using the BY authid-grantor
clause, the authid-grantor must have the right to grant the EXECUTE privilege.
Security Considerations
NonStop SQL/MX translates each authorization ID you specify into a 32-bit integer
value and then stores the number in the system metadata tables. The stored
identification number, not the characters of the authorization ID, is used to identify the
user who holds privileges on the specified objects.
Examples of GRANT EXECUTE
Suppose that the super ID on behalf of the owner of the SPJ, 'SYSMGT.ANDY',
grants EXECUTE and WITH GRANT OPTION privileges on ADJUSTSALARY to
two other users, 'SYSMGT.BEN' and 'SYSMGT.JASON':
GRANT EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
TO 'SYSMGT.BEN', 'SYSMGT.JASON'