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

Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java540433-003
4-2
Using the CREATE PROCEDURE Statement
PROCEDURE statement fails to execute, NonStop SQL/MX does not update system
metadata tables and does not create a procedure label.
For more information, see the Effect of Registering an SPJ on page 1-6.
Using the CREATE PROCEDURE Statement
This subsection explains how to write a CREATE PROCEDURE statement.
The following example shows the CREATE PROCEDURE statement for an SPJ that
does not return result sets:
To construct a CREATE PROCEDURE statement, see:
Naming the Stored Procedure on page 4-3
Specifying SQL Parameters on page 4-4
Specifying the Maximum Number of Result Sets on page 4-7
Specifying the SPJ Method on page 4-8
Specifying the External Path on page 4-10
Naming the Procedure Label on page 4-11
Specifying an SQL Access Mode on page 4-12
The examples in this subsection are based on the SPJ methods in Appendix A,
Sample SPJs.
For the syntax of the CREATE PROCEDURE statement, see the
SQL/MX Reference
Manual
.
VST016.vsd
CREATE PROCEDURE samdbcat.persnl.adjustsalary(IN empnum NUMERIC(4),
IN percent FLOAT,
DYNAMIC RESULT SETS 2 OUT newsalary NUMERIC(8,2))
EXTERNAL NAME 'Payroll.adjustSalary'
EXTERNAL PATH '/usr/mydir/myclasses'
LANGUAGE JAVA
PARAMETER STYLE JAVA
LOCATION $TX0115.ZSDPK4GV.Q85DXB00
MODIFIES SQL DATA;
Method Attributes
External Path of the
SPJ Method
SQL Access Mode
(optional)
Procedure Label
(optional)
SPJ Method
Procedure Name
SQL Parameters