Rules for Call Arguments in ODBC and JDBC - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
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.

  • An OUT argument must be an OUT call placeholder.