Retrieving Number Data - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-08-22
dita:mapPath
xbl1544831938754.ditamap
dita:ditavalPath
nkw1500504256726.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities
The Fixed Number types are mapped to SQL_DECIMAL. The standard SQL_DECIMAL to ODBC C type conversions apply with the following notes:
  • Conversion to SQL_C_BINARY yields the binary representation of the Number value consisting of 1-byte length, 2-byte scale, and 1-17 bytes unscaled value.
  • Conversion to SQL_C_DOUBLE or SQL_C_FLOAT may lose precision. In this case the return code from the conversion will be SQL_SUCCES_WITH_INFO and SQLSTATE 01S07 generates.
Floating Number types are mapped to SQL_DOUBLE. The standard SQL_DOUBLE to ODBC C type conversions apply with the following notes:
  • Conversion to SQL_C_CHAR or SQL_C_WCHAR preserves the full precision of the Floating Number, which may be greater than the current maximum of 15. The format of the string is an ODBC numeric literal using either exponential notation or non-exponential notation depending on the actual value.
  • Conversion to SQL_C_DOUBLE (default conversion) or SQL_C_FLOAT may lose precision. In this case the return code from the conversion is SQL_SUCCES_WITH_INFO and SQLSTATE 01S07 is generated.
  • Conversion to SQL_C_BINARY yields the binary representation of the Number value consisting of 1-byte length, 2-byte scale, and 1-17 bytes unscaled value.