The following additional rules apply to a call argument when the CALL statement is submitted from an ODBC or JDBC application:
- An IN or INOUT argument must be one of the following:
- A value expression.
A value expression must be a constant expression that does not include identifiers prefixed by the COLON character.
- A QUESTION MARK (?) character used as an input placeholder.
If you specify ?, the value for the corresponding IN or INOUT parameter of the called procedure must be set using ODBC- or JDBC-specific calls before calling the procedure.
There is a 1:1 correspondence between the number of ? markers for IN and INOUT arguments and the number of data items specified in the StatementInfo parcel in the request message. StatementInfo does not contain entries for OUT arguments.
For example, consider the following SQL procedure definition and CALL statement:
CREATE PROCEDURE sp3 ( IN pil INTEGER, INOUT pio1 INTEGER, OUT po1 INTEGER) BEGIN SELECT j INTO :pio1 FROM tb11 WHERE i=2; SELECT k INTO :po1 FROM tb11 WHERE i=2; END; CALL sp3 (:?, :?, :?);
When this call is made, the StatementInfo parcel contains 2 entries: one each for the IN and INOUT parameters.
- A value expression.
- An OUT argument must be an OUT call placeholder.