SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
All users with the EXECUTE privilege on the SPJ named MONTHLYORDERS must have the SELECT
privilege on the ORDERS table:
GRANT SELECT
ON TABLE samdbcat.sales.orders
TO PUBLIC;
The types of SQL statements in the underlying SPJ method, such as SELECT, UPDATE, DELETE, and
INSERT, should indicate which privileges, such as SELECT, UPDATE, DELETE, and INSERT, are
required for the referenced database objects.
For the syntax of the GRANT statement, see the SQL/MX Reference Manual. For more information
about granting privileges on SQL/MX database objects, see the SQL/MX Installation and Upgrade
Guide and SQL/MX Management Manual. For information about securing SQL/MP database
objects, see the SQL/MP Installation and Management Guide.
Revoking Privileges on an SPJ
Use the REVOKE EXECUTE or REVOKE statement to remove the EXECUTE or WITH GRANT OPTION
privilege on an SPJ from specific users. In a REVOKE statement, specify ALL PRIVILEGES to revoke
the EXECUTE privilege on an SPJ. For the syntax of the REVOKE EXECUTE and REVOKE statements,
see the SQL/MX Reference Manual.
If you own the SPJ, you can revoke the EXECUTE and WITH GRANT OPTION privileges on the
SPJ from any user to whom you granted those privileges. If you are the super ID acting on behalf
of a grantor, you can revoke the EXECUTE and WITH GRANT OPTION privileges on the SPJ from
any user to whom the grantor granted those privileges. If you are not the owner of the SPJ or the
super ID, you must have been granted the WITH GRANT OPTION privilege to revoke privileges
from other users, and you can revoke privileges only from other users to whom you have granted
privileges.
For example, the HR director of North America can revoke the EXECUTE privilege on ADJUSTSALARY
from one or more of the department managers to whom the director granted privileges. In this
example, the HR director revokes the EXECUTE privilege from the Marketing Department manager:
Granting Privileges for Invoking SPJs 85










