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 Java523727-004
6-15
OBEY Command Files
DROP PROCEDURE Statements in an OBEY Command File
You can use another or the same OBEY command file to drop a series of SPJs. For
example, the OBEY command file, dropprocs.sql, contains a series of DROP
PROCEDURE statements:
To drop SPJs, issue the OBEY command in MXCI:
OBEY dropprocs.sql "DROP SALES SPJs";
GRANT EXECUTE Statements in an OBEY Command File
You can use another or the same OBEY command file to grant privileges on a series of
SPJs. For example, the OBEY command file, grantprocs.sql, contains a series of
GRANT EXECUTE statements:
To grant privileges on the SPJs, issue the OBEY command in MXCI:
OBEY grantprocs.sql "GRANT SALES SPJs";
?SECTION "DROP SALES SPJs"
DROP PROCEDURE samdbcat.sales.lowerprice;
DROP PROCEDURE samdbcat.sales.dailyorders;
DROP PROCEDURE samdbcat.sales.monthlyorders;
DROP PROCEDURE samdbcat.sales.totalprice;
?SECTION "DROP PERSNL SPJs"
DROP PROCEDURE samdbcat.persnl.adjustsalary;
?SECTION "GRANT SALES SPJs"
GRANT EXECUTE
ON samdbcat.sales.monthlyorders
TO PUBLIC;
GRANT SELECT
ON TABLE samdbcat.sales.orders
TO PUBLIC;
?SECTION "GRANT PERSNL SPJs"
GRANT EXECUTE
ON PROCEDURE samdbcat.persnl.adjustsalary
TO "HR.MGRNA", "HR.MGREU"
WITH GRANT OPTION;
GRANT SELECT, UPDATE(salary)
ON TABLE samdbcat.persnl.employee
TO "HR.MGRNA", "HR.MGREU"
WITH GRANT OPTION;