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

HP NonStop SQL/MX Guide to Stored Procedures in Java523727-004
4-1
4
Registering SPJs in NonStop
SQL/MX
This section covers these topics:
Creating an SPJ on page 4-1
Using the CREATE PROCEDURE Statement on page 4-2
Dropping an SPJ on page 4-12
Altering an SPJ and Its Java Class on page 4-13
This section assumes that you have already written and compiled the SPJ methods.
For more information, see Section 3, Writing SPJ Methods.
Creating an SPJ
The CREATE PROCEDURE statement registers an existing Java method as an SPJ
within an SQL/MX database. Registration of an SPJ enables any SQL/MX application
or interface to execute the SPJ method by using a CALL statement.
You can issue a CREATE PROCEDURE statement from any application or interface
that calls NonStop SQL/MX, such as:
SQL/MX conversational interface (MXCI)
Embedded SQL programs in C, C++, or COBOL
SQLJ programs (embedded SQL in Java)
JDBC/MX programs
NonStop ODBC/MX clients
NSM/web
Required Privileges for Creating an SPJ
To issue a CREATE PROCEDURE statement, you must be the owner of the schema,
or the super ID (that is, super.super), and have read access to the Java class file or
JAR file that contains the SPJ method.
Effect of Creating an SPJ
When you execute a CREATE PROCEDURE statement, the identified Java method is
verified to exist in the Java class file and to have attributes that are consistent with
those specified in the CREATE PROCEDURE statement.
Successful execution of the CREATE PROCEDURE statement updates rows in the
system metadata tables and creates a procedure label for the SPJ. If the CREATE
Note. The catalog and schema of the SPJ must exist when you run the CREATE
PROCEDURE statement.