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-5
Specifying SQL Parameters
The identifier conforms to the syntax of other SQL identifiers. For information about
identifiers, see the SQL/MX Reference Manual.
SQL Data Type
The SQL data types must correspond with the underlying Java data types of the SPJ
method, as shown:
Because the Java signature of the SPJ method in this example is (BigDecimal,
double, BigDecimal[]), you should specify these SQL data types, or similar
ones, for the procedure: (NUMERIC, FLOAT, NUMERIC). Recall that all output
parameters (OUT and INOUT) of a Java method must be arrays that accept a single
value. (See Returning Output Values From the Java Method on page 3-2.) In this
example, the type of the output parameter, BigDecimal[], corresponds with the SQL
type, NUMERIC.
For mappings between SQL/MX and Java data types, see Table 4-1 on page 4-6.
VST018.vsd
adjustsalary(IN empnum NUMERIC(4), IN percent FLOAT, OUT newsalary
NUMERIC(8,2))
Stored Procedure
adjustSalary(BigDecimal empNum, double percent, BigDecimal[] newSalary)
SPJ Method