SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
CREATE PROCEDURE samdbcat.sales.monthlyorders(IN INT,
OUT number INT)
EXTERNAL NAME 'pkg.subpkg.Sales.numMonthlyOrders'
EXTERNAL PATH '/usr/mydir/myclasses'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
To drop the SPJ, issue this DROP PROCEDURE statement:
DROP PROCEDURE samdbcat.sales.monthlyorders;
To re-create the SPJ, issue this CREATE PROCEDURE statement:
CREATE PROCEDURE samdbcat.sales.monthlyorders(IN INT,
OUT number INT)
EXTERNAL NAME 'pkg.subpkg.Sales.numMonthlyOrders'
EXTERNAL PATH '/usr/myapps/myJar.jar'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
If a statically compiled program calls this SPJ, you should explicitly recompile the module of that
application. If you do not, NonStop SQL/MX tries to automatically recompile the SQL plan of the
CALL statement at run time.
You can now successfully execute the relocated SPJ method by issuing the existing CALL statements.
Changes to the External Name
The external name identifies the SPJ method that is registered as an SPJ. A change to the external
name of an SPJ suggests either a reassignment of the SPJ method or a fundamental change to the
underlying Java class of the existing SPJ method.
For example, suppose that you reassign the SPJ named MONTHLYORDERS from the SPJ method
numMonthlyOrders() to another SPJ method named numMonthlyOrders2(), which has the
same Java signature.
The SPJ named MONTHLYORDERS was originally registered in system metadata as:
CREATE PROCEDURE samdbcat.sales.monthlyorders(IN INT,
OUT number INT)
EXTERNAL NAME 'pkg.subpkg.Sales.numMonthlyOrders'
EXTERNAL PATH '/usr/myapps/myJar.jar'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
To drop the SPJ, issue this DROP PROCEDURE statement:
DROP PROCEDURE samdbcat.sales.monthlyorders;
To re-create the SPJ, issue this CREATE PROCEDURE statement:
CREATE PROCEDURE samdbcat.sales.monthlyorders(IN INT,
OUT number INT)
EXTERNAL NAME 'pkg.subpkg.Sales.numMonthlyOrders2'
EXTERNAL PATH '/usr/myapps/myJar.jar'
LANGUAGE JAVA
PARAMETER STYLE JAVA
READS SQL DATA;
If a statically compiled program calls this SPJ, you should explicitly recompile the module of that
application. If you do not, NonStop SQL/MX tries to automatically recompile the SQL plan of the
CALL statement at run time.
You can now successfully execute the new SPJ method by issuing the existing CALL statements.
Altering an SPJ and Its Java Class 69










