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

HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
5-1
5
Invoking SPJs in NonStop SQL/MX
This section describes how to execute SPJs and assumes that you have already
registered the SPJs in NonStop SQL/MX. For information about registering an SPJ,
see Section 4, Registering SPJs in NonStop SQL/MX.
This section covers these topics:
Calling an SPJ on page 5-1
Using the CALL Statement on page 5-3
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
Calling an SPJ
The CALL statement invokes an SPJ in NonStop SQL/MX. You can issue the CALL
statement from any of these applications or interfaces that call NonStop SQL/MX:
SQL/MX conversational interface (MXCI)
SQLJ programs (embedded SQL in Java)
JDBC/MX programs
Embedded SQL programs in C, C++, or COBOL
NonStop ODBC/MX clients
You can use the CALL statement only as a stand-alone SQL statement. You cannot
use the CALL statement inside a compound statement, in a trigger, or with rowsets.
Required Privileges for Calling an SPJ
To execute the CALL statement, you must have the EXECUTE privilege on the
procedure. For more information, see Granting Privileges for Invoking SPJs on
page 6-1.