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

Invoking SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
5-5
Listing the Arguments of the SPJ
Because an INOUT parameter passes a single value to and accepts a single value
from an SPJ, you can specify only host variables or dynamic parameters for INOUT
parameter arguments in a CALL statement.
Output Parameter Arguments
An SPJ returns values in OUT and INOUT parameters. Each OUT or INOUT
parameter accepts only one value from an SPJ. Any attempt to return more than one
value to an output parameter results in a Java exception. See Returning Output Values
From the Java Method on page 3-2.
Specify OUT and INOUT parameter arguments as either host variables in a static
CALL statement (for example, :hostvar) or dynamic parameters in a dynamic CALL
statement (for example, ? or ?param).
The parameter arguments that you specify in a CALL statement depend on the
application or interface that calls the SPJ. For information about how to invoke SPJs in
different applications, see:
Invoking SPJs in MXCI on page 5-6
Invoking SPJs Statically in an Embedded SQL Program in C, C++, or COBOL on
page 5-8
Invoking SPJs Dynamically in an Embedded SQL Program in C, C++, or COBOL
on page 5-9
Invoking SPJs in a NonStop ODBC/MX Client on page 5-13
Invoking SPJs in a JDBC/MX Program on page 5-14
Invoking SPJs in an SQLJ Program on page 5-15
Scalar subquery CALL totalprice((SELECT qty_ordered
FROM odetail
WHERE ordernum = 100210
AND partnum = 5100),
'nextday', ?param);
Host variable CALL adjustsalary(:empnum, :percent,
:OUT newsalary);
Dynamic parameter CALL adjustsalary(?, ?, ?);
CALL adjustsalary(?param1, ?param2, ?param3);
Type of Argument Examples