15.00 - Data Conversions in Field Mode - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

Data Conversions in Field Mode

Field Mode: User Response Data

In Field Mode, a report format used in BTEQ, all data is returned in character form. The alignment and spacing of columns is controlled by data formats and title information. Each row returned is essentially a character string ready for display.

In Field Mode, it is unnecessary to explicitly convert numeric data to character format.

Conversions to Numeric Types

When in Field Mode, a numeric overflow returned for character to numeric data type conversion is not treated as an error. If the result exceeds the number of digits normally reserved for the numeric data type, the result appears as a set of asterisks in the report.

For example, the character to SMALLINT conversion in the following statement results in numeric overflow because the number of digits normally reserved for a SMALLINT is five:

   SELECT '100000' (SMALLINT);

The result is:

   '100000'
   --------
     ******

Additionally, when in Field Mode, asterisks appear in the report for conversions to numeric types involving results that do not fit the specified output format.

For example, the DATE to INTEGER conversion in the following statement results in a value that does not fit the format specified by the FORMAT phrase:

   SELECT CAST (CURRENT_DATE as integer format '9999');

The result is:

   Date
   ----
   ****

The same query executed in Record or Indicator Variable Mode reports an error.