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

Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
4-15
Changes to the External Name
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.