If a variable is specified:
If the procedure name is unqualified, it is implicitly qualified based on the path and number of parameters. For more information see Qualification of unqualified object names.
If the procedure-name identifies a procedure that was defined by a DECLARE PROCEDURE statement, and the current server is a DB2 UDB for iSeries server, then:
Otherwise:
If the current server is a DB2 UDB for iSeries, the attributes of the parameters will be the same as the attributes of the arguments specified on the CALL statement. 59
Each parameter defined (using a CREATE PROCEDURE or DECLARE PROCEDURE statement) as OUT or INOUT must be specified as a variable.
The number of arguments specified must be the same as the number of parameters of a procedure defined at the current server with the specified procedure-name.
The application requester assumes all parameters that are variables are INOUT parameters except for Java(TM), where it is assumed all parameters that are variables are IN unless the mode is explicitly specified in the variable reference. All parameters that are not variables are assumed to be input parameters. The actual attributes of the parameters are determined by the current server.
For an explanation of constant and variable, see Constants and References to host variables. For a description of special-register, see Special registers. NULL specifies the null value.
Before the CALL statement is processed, you must set the following fields in the SQLDA. (The rules for REXX are different. For more information, see the Embedded SQL Programming book.)
The SQLDA must have enough storage to contain all SQLVAR occurrences. Therefore, the value in SQLDABC must be greater than or equal to 16 + SQLN*(80), where 80 is the length of an SQLVAR occurrence. If LOBs or distinct types are specified, there must be two SQLVAR entries for each parameter marker and SQLN must be set to two times the number of parameter markers.
SQLD must be set to a value greater than or equal to zero and less than or equal to SQLN. It must be the same as the number of parameters in the CALL statement. The nth variable described by the SQLDA corresponds to the nth parameter marker in the prepared statement. (For a description of an SQLDA, see Appendix D. SQLDA (SQL descriptor area).)
Note that RPG/400(R) does not provide the function for setting pointers. Because the SQLDA uses pointers to locate the appropriate variables, you have to set these pointers outside your RPG/400 application.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.