The INTERVAL type mapping

For Version 2.8, by default, the INTERVAL data type is mapped to a string with the format described in HCL Informix Guide to SQL: Reference. However, a conversion to a numeric type is also allowed. Conversion to a string type facilitates the easy display of user-entered data. The alternate numeric conversion facilitates mathematical manipulation of data by an application.

For day-time intervals, the recommended alternate numeric conversion is to DBTYPE_I8. The number returned has 1/100,000 seconds as the unit of measure.

For year-month intervals, the recommended alternate conversion is to DBTYPE_I8. The number returned has months as the unit of measure.

Conversions of both day-time and year-month interval types to the types DBTYPE_I4, DBTYPE_I2, and DBTYPE_I1 are also allowed; overflow errors are possible for the smaller types.
Important: For numeric conversions, the format of the returned number is different from the format returned in prior releases of the HCL Informix® OLE DB Provider (in order to avoid ambiguity).

Copyright© 2019 HCL Technologies Limited