The Teradata Database Number data types are available in ODBC if supported by the database. A Teradata Database Number type is either Fixed or Floating as listed in the following table.
|Number variant||Database type||Description|
|Fixed Number||NUMBER (p, s)||Fixed decimal of p digits with s fractional digits|
|NUMBER (p)||Equivalent to NUMBER(p, 0)|
|Floating Number||NUMBER (*, s)||Floating decimal of s fractional digits|
|NUMBER (*)||Floating decimal|
|NUMBER||Equivalent to NUMBER(*)|
In ODBC the Number types are treated as standard SQL types. Fixed Number data types are mapped to the standard SQL_DECIMAL data type and Floating Number data types are mapped to SQL_DOUBLE. This means conforming applications do not need to know that the database type corresponding to an SQL_DECIMAL or SQL_DOUBLE is a Number data type.
If an application needs information indicating the database type is a Number type, then the application can examine the Teradata ODBC-specific data type code. This code is returned as a descriptor field in SQLColAttribute and SQLGetDescField. Additionally, the code is returned as a Teradata-specific column in the result set from SQLGetTypeInfo, SQLColumns, and SQLProcedureColumns.
- SQL_TD_FIXED_NUMBER for a Fixed Number
- SQL_TD_FLOATING_NUMBER for a Floating Number