IBM® Informix® Client Software Development Kit, Version 4.10

Implicit data conversion

You can fetch a DATETIME or INTERVAL column value into a character (char, string, or fixchar) host variable. IBM® Informix® ESQL/C converts the DATETIME or INTERVAL column value to a character string before it stores it in the character host variable. This character string conforms to the ANSI SQL standards for DATETIME and INTERVAL values. If the host variable is too short, Informix ESQL/C sets sqlca.sqlwarn.sqlwarn1 to W, fills the host variable with asterisk ( * ) characters, and sets any indicator variable to the length of the untruncated character string.

You can also insert a DATETIME or INTERVAL column value from a character (char, string, fixchar, or varchar) host variable. Informix ESQL/C uses the data type and qualifiers of the column value to convert the character value to a DATETIME or INTERVAL value. It expects the character string to contain a DATETIME or INTERVAL value that conforms to ANSI SQL standards.

If the conversion fails, Informix ESQL/C sets the SQLSTATE status variable to an error-class code (and SQLCODE status variable to a negative value) and the update or insert operation fails.
Important: IBM Informix products do not support automatic data conversion from DATETIME and INTERVAL column values to numeric (double, int, and so on) host variables. Nor do IBM Informix products support automatic data conversion from numeric (double, int, and so on) or date host variables to DATETIME and INTERVAL column values.


Examples exchange | Troubleshooting

To find the PDF, see Publications for the IBM Informix 12.10 family of products.
For the release notes, documentation notes, and/or machine notes, see the Release Notes page.