SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
For more information about ADJUSTSALARY and its underlying SPJ method, adjustSalary(),
see Appendix A: Sample SPJs.
Output of the SHOWDDL Command of an SPJ with Result Sets
To display information about an SPJ that returns result sets (in this example, ORDER_SUMMARY),
enter this SHOWDDL command in an MXCI session:
SHOWDDL PROCEDURE samdbcat.sales.order_summary;
The SHOWDDL command for the ORDER_SUMMARY SPJ returns this output:
CREATE PROCEDURE SAMDBCAT.SALES.ORDER_SUMMARY
(
IN ON_OR_AFTER_DATE VARCHAR(20) CHARACTER SET ISO88591
, OUT NUM_ORDERS LARGEINT
)
EXTERNAL NAME 'SPJMethods.orderSummary
(java.lang.String,long[],java.sql.ResultSet[],java.sql.ResultSet[])'
EXTERNAL PATH '/usr/mydir/myclasses'
LOCATION \ALPINE.$SYSTEM.ZSDCR2C6.L1Z7NW00
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 2
NOT DETERMINISTIC
ISOLATE
;
--- SQL operation complete.
For more information about ORDER_SUMMARY and its underlying SPJ method, orderSummary(),
see Appendix A: Sample SPJs.
Keeping SPJ Statements in OBEY Command Files
Consider keeping your SPJ statements in OBEY command files. That way, you can quickly and
easily create, drop, or reregister SPJs and grant or revoke privileges to the SPJs, as needed. For
more information, see:
• OBEY Command Files (page 94)
• Regenerating CREATE PROCEDURE Statements (page 96)
OBEY Command Files
An OBEY command file is either an OSS text file (odd-unstructured file, type 180) or a Guardian
EDIT file (type 101). For more information about the OBEY command, see the SQL/MX Reference
Manual.
CREATE PROCEDURE Statements in an OBEY Command File
For example, the OBEY command file, createprocs.sql, contains a series of CREATE
PROCEDURE statements:
?SECTION "CREATE SALES SPJs"
CREATE PROCEDURE samdbcat.sales.lowerprice()
EXTERNAL NAME 'Sales.lowerPrice'
EXTERNAL PATH '/usr/mydir/myclasses'
LANGUAGE JAVA
PARAMETER STYLE JAVA
MODIFIES SQL DATA;
...
?SECTION "CREATE PERSNL SPJs"
94 Managing SPJs in NonStop SQL/MX










