Examples Of Call - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Input Parameter Arguments
You pass data to an SPJ by using IN or INOUT parameters. For an IN parameter argument, use
one of these SQL expressions:
Literal
SQL function (including CASE and CAST expressions)
Arithmetic or concatenation operation
Scalar subquery
Dynamic parameter (for example, ?) in an application
Named (for example, ?param) or unnamed (for example, ?) parameter in Neoview Command
Interface (NCI)
For an INOUT parameter argument, you can use only a dynamic, named, or unnamed parameter.
For more information, see
Output Parameter Arguments
An SPJ returns values in OUT and INOUT parameters. Output parameter arguments must be
dynamic parameters in an application (for example, ?) or named or unnamed parameters in
Neoview Command Interface (NCI) (for example, ?param or ?). Each calling application defines
the semantics of the OUT and INOUT parameters in its environment. For more information, see
the Neoview Guide to Stored Procedures in Java.
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
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.
Null Input and Output
You can pass a null value as input to or output from an SPJ, provided that the corresponding
Java data type of the parameter supports nulls. If a null is input or output for a parameter that
does not support nulls, Neoview SQL returns an error. For more information about handling
null input and output, see the Neoview Guide to Stored Procedures in Java.
Transaction Semantics
The CALL statement automatically initiates a transaction if there is no active transaction. However,
the failure of a CALL statement does not always automatically abort the transaction. For more
information, see the Neoview Guide to Stored Procedures in Java.

Examples of CALL

In the Neoview Command Interface (NCI), execute an SPJ named MONTHLYORDERS,
which has one IN parameter represented by a literal and one OUT parameter represented
by an unnamed parameter, ?:
CALL sales.monthlyorders(3,?);
This CALL statement executes a stored procedure, which accepts one IN parameter (a date
literal), returns one OUT parameter (a row from the column, NUM_ORDERS), and returns
two result sets:
CALL sales.ordersummary('01/01/2001', ?);
NUM_ORDERS
--------------------
"Expressions" (page
13
255).
CALL Statement
57

Advertisement

Table of Contents
loading

Table of Contents