Neoview Guide to Stored Procedures in Java (R2.3, R2.4)
procedure input values, the conversion is from the actual argument value to the formal parameter
type. For stored procedure output values, the conversion is from the actual output value, which
has the data type of the formal parameter, to the declared type of the dynamic parameter.
Input Parameter Arguments
To pass data to an IN or INOUT parameter of an SPJ, specify an SQL value expression that
evaluates to a character, date-time, or numeric value. The SQL value expression can evaluate to
NULL provided that the underlying Java parameter supports null values. For more information,
see “Null Input and Output” (page 29).
For an IN parameter argument, use one of these SQL value expressions in Table 7-1:
Table 7-1 Input Parameter Argument Types
ExamplesType of Argument
CALL adjustsalary(202, 5.5, ?);
CALL dailyorders(DATE '2003-03-19', ?);
CALL totalprice(23, 'nextday' , ?param);
Literal
CALL dailyorders(CURRENT_DATE, ?);
SQL function
(including CASE and
CAST expressions)
CALL adjustsalary(202, ?percent * 0.25, :OUT newsalary);
Arithmetic
expression
CALL totalprice(23, 'next' || 'day', ?param);
Concatenation
operation
CALL totalprice((SELECT qty_ordered
FROM odetail
WHERE ordernum = 100210
AND partnum = 5100),
'nextday', ?param);
Scalar subquery
CALL adjustsalary(?, ?, ?);
CALL adjustsalary(?param1, ?param2, ?param3);
Dynamic parameter
For more information about SQL value expressions, see the Neoview SQL Reference Manual. For
guidelines on defining character string literals for the Neoview character set configurations and
SQL character set column definitions, see the Neoview Character Set Administrator's Guide.
Because an INOUT parameter passes a single value to and accepts a single value from an SPJ,
you can specify only dynamic parameters for INOUT parameter arguments in a CALL statement.
Output Parameter Arguments
Except for result sets, an SPJ returns values in OUT and INOUT parameters. Each OUT or INOUT
parameter accepts only one value from an SPJ. Any attempt to return more than one value to an
output parameter results in a Java exception. See “Returning Output Values From the Java
Method” (page 26).
OUT and INOUT parameter arguments must be dynamic parameters in a client application (for
example, ?) or named or unnamed parameters in NCI (for example, ?param or ?).
For information about how to call SPJs in different applications, see:
• “Calling SPJs in NCI” (page 66)
• “Calling SPJs From an ODBC Client Application” (page 68)
• “Calling SPJs From a JDBC Client Application” (page 69)
Using the CALL Statement 65