Record (In Record Mode) - Call-Level Interface Version 2

Teradata® Call-Level Interface Version 2 Reference for Workstation-Attached Systems

Product
Call-Level Interface Version 2
Release Number
16.20
Published
September 2019
Language
English (United States)
Last Update
2019-10-12
dita:mapPath
uny1527114222311.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2418
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose

In Record Mode, nulls are not explicitly identified in the Record parcel, when Return-statement-info 'Y' was not specified.

Usage Notes

Note that a Teradata SQL SHOW TABLE statement returns only one Record parcel.

Within the Record parcel, each line of a table is separated from the next by hex 0D (decimal 13).

This parcel is generated by Teradata Database.

Parcel Data

The following information applies to the Record parcel (in Record Mode).

Flavor Parcel Body Length Parcel Body Fields
10 1 to maximum body size Data: organized as:

item 1, item2, . . . , item i, . . . , item n

If in Record Mode, the Record parcel for an ECHO statement does NOT contain zeros.

Field Notes

The Data Field contains items with characteristics as follows:
  • The order of the items. Each expression in the SELECT statement generates one item in the Record Mode Record parcel, in the order listed in the SELECT statement. That is, the ith item in the Record Mode Record parcel contains the result of the ith expression in the SELECT statement.
  • The data type of each item. Each expression has a resulting data type, as governed by data type conversion rules.

    One method for obtaining the resulting data type of an expression is to use the HELP COLUMN statement on that expression.

    For details, see the description of the HELP COLUMN statement in the SQL Data Definition Language (B035-1144).

    An alternate method for obtaining the resulting data type of an expression is to consult the data type conversion rules.

    The rules begin with the data type of the elementary operands (columns in CREATE TABLE statements, variables in USING row descriptors, constants in expressions, and built-in values in expressions).

    The rules then account for the effects of operations on the elementary operands (explicit data type conversion in description phrases of expressions, arithmetic operations in expressions, character operations in expressions, and functions and aggregate operations in expressions).

    For details, see SQL Data Types and Literals (B035-1143) and SQL Functions, Operators, Expressions, and Predicates (B035-1145) for pointers to the rules.

  • The length and format of each item.
  • The contents of each item are in client internal format as determined by the resulting data type of the expression.
  • For the form that a null value takes in each of these data types, see “Manipulating Nulls” in SQL Fundamentals (B035-1141).
Teradata Database Internal Format 
Teradata SQL Data Type Teradata Database Internal Format
BYTEINT 8-bit signed two’s complement binary number (1 byte)
SMALLINT 16-bit signed two’s complement binary number, most significant byte first (2 bytes)
INTEGER 32-bit signed two’s complement binary number, most significant byte first (4 bytes)
FLOAT 64-bit long (double precision) floating point number, most significant byte first, 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) 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)
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 two’s complement integer, most significant byte first (4 bytes); DATE is calculated as follows: (year-1900)*10000 + month*100 + day
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)
NUMERIC see description for DECIMAL
REAL see description for FLOAT
DOUBLE PRECISION see description for FLOAT