SQL/MX Guide to Stored Procedures in Java (G06.24+, H06.03+)

Sample SPJs
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
A-22
SUPPLYNUMBERS Stored Procedure
CREATE PROCEDURE Statement
CREATE PROCEDURE samdbcat.invent.supplynumbers(OUT avrg INT,
OUT minm INT,
OUT maxm INT)
EXTERNAL NAME 'Inventory.supplyQuantities'
EXTERNAL PATH '/usr/mydir/myclasses'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
CALL Statement to Invoke the SPJ
To invoke the SUPPLYNUMBERS procedure in MXCI:
CALL samdbcat.invent.supplynumbers(?, ?, ?);
The SUPPLYNUMBERS procedure returns this output in MXCI:
AVRG MINM MAXM
----------- ----------- -----------
167 0 1132
--- SQL operation complete.
The average number of items in inventory is 167, the minimum number is 0, and the
maximum number is 1132.