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-3
Using the CALL Statement
Effect of the jdbcmx.transactionMode Property
If you set the jdbcmx.transactionMode property in a UDR_JAVA_OPTIONS
attribute, you might affect the transaction behavior of an SPJ. By default, an SPJ
method runs in the default mixed transaction mode. The mixed and external
transaction modes do not interfere with transaction behavior of the calling application.
However, if you set jdbcmx.transactionMode to internal in a
UDR_JAVA_OPTIONS attribute, the external transaction of the calling application will
be suspended, and the SQL operations of the SPJ method will be executed in an
internal JDBC-managed transaction. The internal transaction mode prevents an
SPJ method from inheriting a transaction from its caller and prevents the calling
application from determining the outcome of an internal JDBC-managed transaction.
For those reasons, do not use the internal transaction mode in an SPJ
environment.
For information about jdbcmx.transactionMode, see the JDBC Driver for SQL/MX
Programmers Reference.
Using the CALL Statement
To invoke a stored procedure, specify the name of the stored procedure and its
arguments in a CALL statement, as shown:
For the syntax of the CALL statement, see the SQL/MX Reference Manual.
Specifying the Name of the SPJ
In the CALL statement, specify the name of an SPJ that you have already registered in
NonStop SQL/MX. Qualify the procedure name with the same catalog and schema that
you specified in the CREATE PROCEDURE statement. For example:
SET SCHEMA samdbcat.persnl;
CALL adjustsalary(202, 5.5, ?);
If you do not fully qualify the procedure name, NonStop SQL/MX qualifies it according
to the current settings of CATALOG and SCHEMA in the SYSTEM_DEFAULTS table.
For more information, see the SQL/MX Reference Manual.
VST021.vsd
CALL samdbcat.persnl.adjustsalary(202, 5.5, ?)
Parameter
Argument List
Procedure Name
Input
Parameter
Arguments
Output
Parameter
Argument