Converting Data between SQL Types and C Types

ODBC Driver for Teradata® User Guide

brand
Teradata Tools and Utilities
prodname
ODBC Driver for Teradata
vrm_release
16.20
category
User Guide
featnum
B035-2526-108K
When converting data between a SQL type and a C Interval type, the new driver returns some results differently than the old driver because the new driver supports more conversions. The old driver does not support the following conversions and returns SQLState 07006; the new driver converts the data successfully as shown in the example below:
  • Numeric types (BIGINT, BIT, DOUBLE, FLOAT, INTEGER, REAL, SMALLINT, TINYINT) to:
    • INTERVAL DAY TO HOUR
    • INTERVAL DAY TO MINUTE
    • INTERVAL DAY TO SECOND
    • INTERVAL HOUR TO MINUTE
    • INTERVAL HOUR TO SECOND
    • INTERVAL MINUTE TO SECOND
  • INTERVAL DAY to INTERVAL SECOND
  • INTERVAL HOUR to INTERVAL SECOND
  • INTERVAL DAY TO HOUR to INTERVAL SECOND
  • INTERVAL DAY TO SECOND to INTERVAL SECOND
  • INTERVAL HOUR TO MINUTE to INTERVAL SECOND
  • INTERVAL MONTH to INTERVAL YEAR
  • INTERVAL HOUR to INTERVAL DAY
  • INTERVAL MINUTE to INTERVAL DAY
  • INTERVAL MINUTE to INTERVAL HOUR
  • INTERVAL MINUTE to INTERVAL DAY TO HOUR
  • INTERVAL SECOND to INTERVAL DAY
  • INTERVAL SECOND to INTERVAL HOUR
  • INTERVAL SECOND to INTERVAL MINUTE
  • INTERVAL SECOND to INTERVAL DAY TO HOUR
  • INTERVAL SECOND to INTERVAL DAY TO MINUTE
  • INTERVAL SECOND to INTERVAL HOUR TO MINUTE
  • INTERVAL YEAR TO MONTH to INTERVAL YEAR
  • INTERVAL DAY TO HOUR to INTERVAL DAY
  • INTERVAL DAY TO MONTH to INTERVAL DAY
  • INTERVAL DAY TO MONTH to INTERVAL HOUR
  • INTERVAL DAY TO MONTH to INTERVAL DAY TO HOUR
  • INTERVAL DAY TO SECOND to INTERVAL DAY
  • INTERVAL DAY TO SECOND to INTERVAL HOUR
  • INTERVAL DAY TO SECOND to INTERVAL MINUTE
  • INTERVAL DAY TO SECOND to INTERVAL DAY TO MINUTE
  • INTERVAL DAY TO SECOND to INTERVAL HOUR TO MINUTE
  • INTERVAL HOUR TO MINUTE to INTERVAL DAY
  • INTERVAL HOUR TO MINUTE to INTERVAL HOUR
  • INTERVAL HOUR TO MINUTE to INTERVAL DAY TO HOUR
  • INTERVAL HOUR TO SECOND to INTERVAL DAY
  • INTERVAL HOUR TO SECOND to INTERVAL HOUR
  • INTERVAL HOUR TO SECOND to INTERVAL DAY TO HOUR
  • INTERVAL MINUTE TO SECOND to INTERVAL DAY
  • INTERVAL MINUTE TO SECOND to INTERVAL HOUR
  • INTERVAL MINUTE TO SECOND to INTERVAL MINUTE
  • INTERVAL MINUTE TO SECOND to INTERVAL DAY TO HOUR
  • INTERVAL MINUTE TO SECOND to INTERVAL DAY TO MINUTE
  • INTERVAL MINUTE TO SECOND to INTERVAL HOUR TO MINUTE
  • SQL_C_DOUBLE to SQL_INTERVAL_MONTH
  • SQL_C_DOUBLE to SQL_INTERVAL_YEAR
  • SQL_C_FLOAT to SQL_INTERVAL_MONTH
  • SQL_C_FLOAT to SQL_INTERVAL_YEAR