SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)

CREATE PROCEDURE samdbcat.persnl.adjustsalary(IN empnum NUMERIC(4),
IN percent FLOAT,
OUT newsalary NUMERIC(8,2))
EXTERNAL NAME 'Payroll.adjustSalary'
EXTERNAL PATH '/usr/mydir/myclasses'
LANGUAGE JAVA
PARAMETER STYLE JAVA
MODIFIES SQL DATA;
...
To create SPJs from an OBEY command file, issue the OBEY command in MXCI:
OBEY createprocs.sql;
NOTE: The SPJ class must exist on the disk for the CREATE PROCEDURE statements to run
successfully.
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:
?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;
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:
?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
Keeping SPJ Statements in OBEY Command Files 95