Format of the CALL statement
Most simple CALL statements use the following format:
CALL spname(parm1, parm2, parmx)
Example: This basic CALL statement is for a stored procedure
that has two input parameters that are defined as decimal data with
a precision of five and a scale of two.:
CALL USERAPROC1(123.45,1.22)
For more information about the CALL statement, see DB2 QMF Reference.
The QMF supported syntax is slightly different from the DB2 CALL
statement.
To enter the CALL statement on the SQL QUERY panel:
- You must be authorized to run the stored procedure and know
the name of the stored procedure that you want to run.
- Parameters must be entered in the order that the stored procedure
is expecting them. For example, if a stored procedure has two parameters
(the first being a decimal and the second being a character string),
you must enter the parameters in that same order on your CALL statement.
You must know the number of expected parameters and the data type
of each parameter. Output parameters must be initialized to blank
character for character strings, or zero for numeric data. QMF global
variables can be used to enter input, inout, and to receive output
parameters. You must use QMF global variable output or inout parameters
if you want to view the returned data. Character strings, all numeric
data types, date, time, and datestamp data types are supported for
input, output, or inout parameters. Thirty-two parameters is the
maximum that can be entered on the CALL statement. The maximum amount
of data that can be entered for a parameter is 32 KB.
- DATE, TIME, and TIMESTAMP data types must be enclosed
in single quotes.
- When entering decimal data, the scale must match exactly
what the stored procedure expects, or you will receive an error
message.
- When you run a stored procedure that returns result
sets, QMF supports the return of the first 32 result sets. Select
the one that you want to use by setting the global variable DSQEC_SP_RS_NUM.
The default setting is one. To ignore the result sets, set the global
variable to zero.
