SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
To construct a CREATE PROCEDURE statement, see:
• Naming the Stored Procedure (page 60)
• Specifying SQL Parameters (page 61)
• Specifying the SPJ Method (page 64)
• Specifying the External Path (page 66)
• Naming the Procedure Label (page 66)
• Specifying an SQL Access Mode (page 67)
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.
When selecting a procedure name:
• Choose a meaningful and unique name that does not already exist for a procedure, table,
view, or SQL/MP alias in the same schema.
For example, use the procedure name ADJUSTSALARY for a Java method named
adjustSalary() that adjusts an employee's salary in the EMPLOYEE table.
• Use delimited identifiers sparingly. The procedure name is upshifted for interpretation except
for the parts that you specify as delimited identifiers.
For example, if you specify a procedure name of AdjustSalary in the CREATE PROCEDURE
statement, the interpreted name is ADJUSTSALARY. To call this SPJ, you can use lowercase
or uppercase for the procedure name, as shown:
CALL samdbcat.persnl.adjustsalary(202, 5.5, ?);
If you specify a procedure name of "AdjustSalary" in the CREATE PROCEDURE statement,
the interpreted name is "AdjustSalary". To call this SPJ, you must delimit the case-sensitive
part of the procedure name in double quotes, as shown:
CALL samdbcat.persnl."AdjustSalary"(202, 5.5, ?);
For information about delimited identifiers, see the SQL/MX Reference Manual.
60 Registering SPJs in NonStop SQL/MX










