SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
TO "HR.MGRNA", "HR.MGREU"
WITH GRANT OPTION;
To grant privileges on the SPJs, issue the OBEY command in MXCI:
OBEY grantprocs.sql "GRANT SALES SPJs";
REVOKE EXECUTE Statements in an OBEY Command File
You can use another or the same OBEY command file to revoke privileges on a series of SPJs. For
example, the OBEY command file, revokeprocs.sql, contains a series of REVOKE EXECUTE
statements:
?SECTION "REVOKE SALES SPJs"
REVOKE EXECUTE
ON PROCEDURE samdbcat.sales.monthlyorders
FROM PUBLIC;
REVOKE SELECT
ON TABLE samdbcat.sales.orders
FROM PUBLIC;
?SECTION "REVOKE PERSNL SPJs"
REVOKE GRANT OPTION FOR EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
FROM "HR.MGRNA", "HR.MGREU"
CASCADE;
REVOKE EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
FROM "HR.MGRNA", "HR.MGREU"
CASCADE;
REVOKE SELECT, UPDATE(salary)
ON TABLE samdbcat.persnl.employee
FROM "HR.MGRNA", "HR.MGREU"
CASCADE;
To revoke privileges on the SPJs, issue the OBEY command in MXCI:
OBEY revokeprocs.sql "REVOKE SALES SPJs";
Regenerating CREATE PROCEDURE Statements
Use the SHOWDDL command to regenerate the CREATE PROCEDURE statements of registered
SPJs in a new or existing OBEY command file:
1. In an MXCI session, enter the LOG command so that MXCI writes the output of the SHOWDDL
command to a log file:
LOG createprocs.sql;
2. In the same MXCI session, enter the SHOWDDL command for specific SPJs in the database:
SHOWDDL PROCEDURE samdbcat.sales.dailyorders;
SHOWDDL PROCEDURE samdbcat.sales.monthlyorders;
...
For the syntax of the SHOWDDL command, see the SQL/MX Reference Manual.
3. To end logging, enter the LOG command without the name of the log file:
96 Managing SPJs in NonStop SQL/MX










