Conversion Rules - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Preprocessor2
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2023-11-20
dita:mapPath
nyr1691484085721.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
xfi1470440464166
Product Category
Teradata Tools and Utilities
  • Numeric values cannot be returned to character or byte strings. The only exception to this is DATE. DATE fields can be returned to character fields (not byte) if the length of the field can hold the conversion type requested by the precompiler DATE option. See DATE(D|E|I|J|U) -d D|E|I|J|U.
  • BYTE and VARBYTE strings can be returned to any valid host variable type. The byte string is moved one byte at a time for the length of the receiving variable. No data conversion is performed and the application is responsible for handling the returned data.
  • CHAR and VARCHAR strings can only be returned to CHAR or VARCHAR type variables.
  • DATE values can be returned to any numeric type (DECIMAL, NUMERIC, INTEGER, FLOAT, REAL, DOUBLE PRECISION) as long as the value is representable in the receiving type. DATE in its natural format (such as a DESCRIBE for a dynamic request) is equivalent to INTEGER.

    DATE can also be returned to CHAR or VARCHAR fields, provided the length of the receiving field can hold the format requested. The character variable must be at least length 8 to receive the date in any of the allowable formats.

  • DECIMAL values can be returned to any numeric type (DECIMAL, NUMERIC, INTEGER, SMALLINT, BYTEINT, FLOAT, REAL, DOUBLE PRECISION) as long as the value is representable in the receiving type.
  • BYTEINT, SMALLINT and INTEGER values can be returned to any numeric type (DECIMAL, NUMERIC, INTEGER, SMALLINT, BYTEINT, FLOAT, REAL, DOUBLE PRECISION) as long as the value is representable in the receiving type.
  • FLOAT values can be returned to any numeric type (DECIMAL,NUMERIC, INTEGER, SMALLINT, BYTEINT, FLOAT, REAL, DOUBLE PRECISION) as long as the value is representable in the receiving type.

    The Teradata SQL FLOAT, REAL and DOUBLE PRECISION types are equivalent to a DOUBLE PRECISION FLOAT. PP2 recognizes SINGLE and DOUBLE PRECISION FLOAT host variable types. Fractional portions of the value might be lost in conversion to a type other than DOUBLE PRECISION FLOAT.

  • GRAPHIC and VARGRAPHIC strings can only be returned to GRAPHIC or VARGRAPHIC type variables.