SQL/MX Guide to Stored Procedures in Java (G06.24+, H06.03+)

Managing SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Javaā€”523727-004
6-2
Granting Privileges on an SPJ
you are not the owner of the SPJ or the super ID, you must have been granted the
WITH GRANT OPTION privilege to grant privileges to other users.
As the owner of an SPJ, or the super ID acting on behalf of a user with the WITH
GRANT OPTION privilege, you can selectively grant the EXECUTE and WITH GRANT
OPTION privileges to specified users. For some SPJs, particularly ones that handle
sensitive information or modify data, you should grant the EXECUTE and WITH
GRANT OPTION privileges to a restricted number of users.
For example, the SPJ named ADJUSTSALARY changes an employeeā€™s salary in the
database. Therefore, only specific users should be allowed to invoke this SPJ. In this
example, the database administrator (the super ID), acting on behalf of the SPJ owner,
grants the EXECUTE and WITH GRANT OPTION privileges on ADJUSTSALARY to
the regional HR directors. The HR directors grant the EXECUTE privilege on
ADJUSTSALARY to the department managers:
In some cases, all users of a database system might need to invoke an SPJ. For
example, the SPJ named MONTHLYORDERS determines the number of product
orders during a given month. This SPJ does not handle sensitive information or modify
data and might be useful to anyone within the company. Therefore, the database
Database Administrator
super ID
VST012.vsd
GRANT EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
TO "HR.MGRNA", "HR.MGREU"
WITH GRANT OPTION;
HR Director North America
HR.MGRNA
GRANT EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
TO "MKG.RAYMOND", "RD.MCKAY",
"CORP.GREEN";
Manager
Marketing Department
MKG.RAYMOND
Manager
Research Department
RD.MCKAY
Manager
Corporate Department
CORP.GREEN
HR Director Europe
HR.MGREU