- 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. See the following table for a description of the data structure for applications on mainframe-attached systems.
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: (year - 1900 x 10000 + (month x 100) + day 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:
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:
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:
The first area is the beginning timestamp for the period; the second area is the ending timestamp. |