17.05 - Rules For Call Arguments In ODBC And JDBC - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Advanced SQL Engine
Teradata Database
Release Number
Release Date
January 2021
Content Type
Programming Reference
Publication ID
English (United States)
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 not contain identifiers prefixed by the COLON character. It must be a constant expression.

    • 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 prior to 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)
             SELECT j INTO :pio1
             FROM tb11
             WHERE i=2;
             SELECT k INTO :po1
             FROM tb11
             WHERE i=2;
           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.