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

Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
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, as shown
in this example:
To construct a CREATE PROCEDURE statement, see:
Naming the Stored Procedure on page 4-2
Specifying SQL Parameters on page 4-4
Specifying the SPJ Method on page 4-7
Specifying the External Path on page 4-9
Naming the Procedure Label on page 4-10
Specifying an SQL Access Mode on page 4-11
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.
Naming the Stored Procedure
Choose the name of the procedure and specify it in the form of an ANSI logical name,
as shown:
CREATE PROCEDURE samdbcat.persnl.adjustsalary ...
The procedure name you select is used in the CALL statements that invoke the SPJ
and identifies the underlying SPJ method.
VST016.vsd
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
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