Neoview Guide to Stored Procedures in Java (R2.3, R2.4)
Multithreading
Neoview SQL manages a single thread of execution within an SPJ environment, even if the
application that issues a CALL statement is a multithreaded Java application. The CALL statements
in a multithreaded application can execute in a nonblocking manner, but the SPJ methods
underlying those CALL statements execute serially within a given SPJ environment.
Using the CALL Statement
To invoke a stored procedure, specify the name of the stored procedure and its arguments in a
CALL statement, as shown in Figure 7-1:
Figure 7-1 CALL Statement Elements
For the syntax of the CALL statement, see the Neoview SQL Reference Manual.
Specifying the Name of the SPJ
In the CALL statement, specify the name of an SPJ that you have already created in the Neoview
database. Qualify the procedure name with the same schema that you specified when you
registered the SPJ. For example:
CALL persnl.adjustsalary(202, 5.5, ?);
Or, for example:
SET SCHEMA persnl;
CALL adjustsalary(202, 5.5, ?);
If you do not fully qualify the procedure name, Neoview SQL qualifies the procedure according
to the schema of the current session.
Listing the Parameter Arguments of the SPJ
Each argument that you list in the CALL statement must correspond with an SQL parameter of
the SPJ. A result set in the Java signature of the SPJ method does not correspond with an SQL
parameter. Do not specify result sets in the argument list.
For example, if you registered the stored procedure with three SQL parameters (two IN parameters
and one OUT parameter), you must list three formal parameter arguments, separated by commas,
in the CALL statement:
CALL persnl.adjustsalary(202, 5, ?);
If the SPJ does not accept arguments, you must specify empty parentheses, as shown:
CALL sales.lowerprice();
If the SPJ has one IN parameter, one OUT parameter, and two result sets, you must list the IN
and OUT parameters but not the result sets in the argument list:
CALL sales.ordersummary('01-01-2001', ?);
Data Conversion of Parameter Arguments
Neoview SQL performs an implicit data conversion when the data type of a parameter argument
is compatible with but does not match the formal data type of the stored procedure. For stored
64 Executing SPJs