SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
5 Invoking SPJs in NonStop SQL/MX.............................................................71
Calling an SPJ........................................................................................................................71
Required Privileges for Calling an SPJ...................................................................................71
Effect of Calling an SPJ.......................................................................................................71
Transaction Behavior..........................................................................................................71
Using the CALL Statement........................................................................................................72
Specifying the Name of the SPJ...........................................................................................73
Listing the Arguments of the SPJ...........................................................................................73
Invoking SPJs in MXCI.............................................................................................................74
Using MXCI Named Parameters...........................................................................................75
Using MXCI Unnamed Parameters........................................................................................75
Using MXCI with SPJ RS......................................................................................................76
Invoking SPJs Statically in an Embedded SQL Program in C, C++, or COBOL................................76
Invoking SPJs Dynamically in an Embedded SQL Program in C, C++, or COBOL............................77
Input and Output Descriptors...............................................................................................77
Argument Lists...................................................................................................................79
Invoking SPJs in a NonStop ODBC/MX Client............................................................................80
Invoking SPJs in a JDBC/MX Program.......................................................................................81
Invoking SPJs in a Trigger........................................................................................................81
6 Managing SPJs in NonStop SQL/MX..........................................................83
Granting Privileges for Invoking SPJs.........................................................................................83
Granting Privileges on an SPJ..............................................................................................83
Granting Privileges on Referenced Database Objects..............................................................84
Revoking Privileges on an SPJ..............................................................................................85
Displaying Information About SPJs............................................................................................88
Listing the SPJs in a Catalog................................................................................................88
Showing Privileges on the SPJs.............................................................................................89
Showing the Procedure Label...............................................................................................91
Showing the Syntax of an SPJ..............................................................................................92
Keeping SPJ Statements in OBEY Command Files........................................................................94
OBEY Command Files........................................................................................................94
Regenerating CREATE PROCEDURE Statements......................................................................96
Backing Up SPJs.....................................................................................................................97
Using SPJs in a Distributed Database Environment.......................................................................98
Copying Java Classes to the Remote Node............................................................................98
Specifying the Node in the External Path...............................................................................99
Distributing Application Classes.........................................................................................100
7 Performance and Troubleshooting.............................................................101
Troubleshooting SPJ Problems.................................................................................................101
Performance Tips..................................................................................................................101
Displaying an Execution Plan for a CALL Statement...................................................................102
Using the DISPLAY_EXPLAIN Command..............................................................................102
Using the EXPLAIN Function..............................................................................................102
Using the EXPLAIN function with SPJ RS..............................................................................103
Displaying the Shape of a CALL Statement...............................................................................103
CALL Statements Without a Shape.....................................................................................103
CALL Statements With a Shape..........................................................................................103
A Sample SPJs..........................................................................................105
Using Sample SPJs................................................................................................................105
Installing the SampleSPJs.jar File........................................................................................105
Installing the SQL/MX Sample Database............................................................................105
Class Files and Java Methods.................................................................................................106
Sales Class.....................................................................................................................107
Contents 5










