Purpose
The Record parcel returns one row of selected results. In Indicator Mode, null values are explicitly identified.
Usage Notes
In Indicator Mode, the parcel immediately before the first Record Mode Record parcel is a Success parcel; in Indicator Mode, the parcel immediately before the first Indicator Mode Record parcel is a DataInfo parcel, which is preceded by the Success parcel.
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 the database.
Parcel Data
The following information applies to the Record parcel (in Indicator Mode).
Flavor | Parcel Body Length | Parcel Body Fields |
---|---|---|
10 | 2 to maximum body size | NullIndicators: (n+7)/8 bytes where: n = the number of items in the Data Field, organized as: bit 1, but 2, . . . , bit i, . . . , but n, unused bits Data: body length - ((n+7) / 8) bytes organized as: item 1, item2, . . . , item i, . . . , item n |
Field Notes
- The NullIndicators Field contains one bit for each item in the DataField, stored in the minimum number of 8-bit bytes required to hold them, with the unused bits in the rightmost byte set to zero.
Each bit is matched on a positional basis to an item in the Data Field. That is, the ith bit in the NullIndicators Field corresponds to the ith item in the Data Field.
If a bit is... Then the value of the corresponding data item is... ON null. OFF not null.
Whether the null indicator bit is ON or OFF, the length of the corresponding data item is meaningful.
The Data Field contains a formatted record of data:
If the data item is to contain... | Then... |
---|---|
a variable length string | the length portion of the data item is set to the actual length of the string which is zero if the data item represents a null value. |
an integer | the data item will occupy four bytes which is zeros if the data item represents a null value. |
- The Data Field contains items with characteristics as follows:
- The order of the items.
Each expression in the SELECT statement generates one data item in the Indicator Mode Record parcel, in the order listed in the SELECT statement.
That is, the ith data item in the Indicator Mode Record parcel contains the result of the ith expression in the SELECT statement.
- The data type of each item.
Each item in the Data Field of the Indicator Mode Record parcel has the data type which is specified in the corresponding data type code in the DataInfo parcel between the Success parcel and the first Indicator Mode Record parcel.
That is, the ith data item in the Indicator Mode Record parcel has the ith data type coded in the DataInfo parcel.
- The length of each item.
Each item in the Data Field of the Indicator Mode Record parcel has the length which is specified in the corresponding length in the DataInfo parcel between the Success parcel and first Indicator Mode Record parcel.
That is, the ith data item in the Indicator Mode Record parcel has the ith length in the DataInfo parcel.
- The format of each item.
The contents of each item are in client internal format, as determined by the data type. For data types, see Data Type.
For the form that a null value takes for each of these data types, see “Manipulating Nulls” in Teradata Vantage™ - SQL Fundamentals, B035-1141.
- The order of the items.