Response-mode - Call-Level Interface Version 2

Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems

Product
Call-Level Interface Version 2
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
dita:id
B035-2417
lifecycle
previous
Product Category
Teradata Tools and Utilities

Response‑mode

The types of parcels returned in a response that selects database fields are determined when the request is made. Four such response modes exist:

  • Field mode, which returns database fields formatted as character data. (Large Objects [LOBs] return errors.)
  • Record Mode, which returns non-null fields as unformatted data. (LOBs return errors.)
  • Indicator Mode, which returns all fields as unformatted data. (LOBs return errors.)
  • MultipartIndicator mode, which returns all fields, including LOBs, as unformatted data with additional character set detail.
  • When unformatted data is returned for Record, MultipartIndicator, and Indicator modes, it is presented in a data structure that is meaningful to the application. Table 1 describes the data structure for applications on mainframe-attached systems.

     

    Table 1: Teradata SQL Data Type and Mainframe Internal Format 

    Teradata SQL Data Type

    Mainframe Internal Format

    BYTEINT

    8‑bit signed integer (1 byte)

    SMALLINT

    16‑bit signed integer (2 bytes)

    INTEGER

    32‑bit signed integer (4 bytes)

    FLOAT

    REAL

    DOUBLE PRECISION

    64‑bit floating point number with 1 bit for fraction sign, 7 bits for unsigned power of 16 exponent (stored as actual + hex 40) and 56 bits for unsigned fraction (8 bytes)

    DECIMAL (x, y)

    NUMERIC

    x‑digit, signed, packed decimal in which the rightmost nibble represents the sign (“+” is hex A, E, F or C; “‑” is hex B or D) and the remaining nibbles represent the digits (hex 0‑9) which are left‑padded with zero digit if x is even (total of (x+2)/2 bytes; 8 bytes)

    CHAR (n)

    n bytes (either n single byte characters; (n-2)/2
    double byte characters, preceded by the Shift-out control character, X
    '0E', and followed by the Shift-in control character, X'0F'; or some mixture of the two not exceeding n bytes). n defaults to 1 if no value is specified.

    BIGINT

    Represents a signed, binary integer value from
    -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

    BIGINT values are stored as eight bytes with the least significant byte first.

    VARCHAR (n)

    (actual length k,

    where 0 <= k <= n )

    SMALLINT (2 bytes) containing actual count k, followed by k bytes (either k single byte characters; (k-2)/2 double byte characters, preceded by the Shift-out control character, X'0E', and followed by the Shift-in control character, X'0F'; or some mixture of the two not exceeding k bytes)

    LONG VARCHAR

    equivalent to VARCHAR (32000)

    GRAPHIC(n)

    GRAPHIC(n), n characters (2 < = n bytes), n defaults to 1 if no value is specified.

    VARGRAPHIC(n) (actual length k, where 0 <= k <= n )

    SMALLINT (2 bytes) containing actual count k, followed by k characters (total of 2 + 2 < = k bytes)

    LONG VARGRAPHIC

    equivalent to VARGRAPHIC(16000)

    BYTE (n)

    n bytes, n defaults to 1 if no value is specified.

    VARBYTE (n)

    (actual length k,

    where 0 <= k <= n )

    16‑bit SMALLINT (2 bytes), actual count k, followed by k bytes (total of k+2 bytes)

    DATE

    32‑bit signed integer (4 bytes); DATE is calculated as follows: (year‑1900)*10000 + month*100 + day

    PERIOD (DATE)

    Two 4-byte signed integers, each calculated as:


    The first integer is the period's beginning date; the second integer is the period's ending date.

    PERIOD (TIME)

    Two 6-byte areas, each consisting of the following:

  • A 4-byte signed integer for the number of seconds (scaled with the rightmost six decimal digits that contain fractional seconds)
  • A 1-byte unsigned integer for the hours
  • A 1-byte unsigned integer for the minutes
  • The first area is the beginning time for the period; the second area is the ending time.

    PERIOD (TIME WITH TIMEZONE)

    Two 8-byte areas, each consisting of the following:

  • A 4-byte signed integer for the number of seconds (scaled with the rightmost six decimal digits that contain fractional seconds).
  • A 1-byte unsigned integer for the hours.
  • A 1-byte unsigned integer for the minutes.
  • A 1-byte unsigned integer for the hourly displacement of the timezone normalized to 16. (Values less than 16 represent a negative displacement, a value of 16 is zero displacement, and values greater than 16 represent a positive displacement.)
  • A 1-byte unsigned integer for the timezone's minutes of displacement.
  • The first area is the beginning time for the period; the second area is the ending time.

    PERIOD (TIMESTAMP WITH TIMEZONE)

    Two 12-byte areas, each consisting of the following:

  • A 4-byte signed integer for the number of seconds (scaled with the rightmost six decimal digits containing fractional seconds).
  • A 2-byte signed integer for the year.
  • A 1-byte unsigned integer for the month.
  • A 1-byte unsigned integer containing the day.
  • A 1-byte unsigned integer containing the hour.
  • A 1-byte unsigned integer containing the minute.
  • A 1-byte unsigned integer containing the timezone's hourly displacement normalized to 16. (Values less than 16 represent a negative displacement, a value of 16 is zero displacement, and values greater than 16 represent a positive displacement.)
  • A 1-byte unsigned integer containing the timezone's minutes of displacement.
  • The first area is the beginning timestamp for the period; the second area is the ending timestamp.