Home | Previous Page | Next Page   Data Manipulation > Using Date and Time Data Types > Date-Time or Interval Data >

Retrieval and Insertion of DATETIME and INTERVAL Values

When an application retrieves or inserts a DATETIME or INTERVAL value, the DataBlade API module must ensure that the qualifier field of the variable is valid:

Fetch or Insert into an mi_datetime Variable

When a DataBlade API module uses an mi_datetime variable to fetch or insert a DATETIME value, the module must find a valid qualifier in the mi_datetime variable. The DataBlade API takes one the following actions, based on the value of the dt_qual field in the dtime_t structure that is associated with the variable:

Fetch or Insert into an mi_interval Variable

When a DataBlade API module uses an mi_interval variable to fetch or insert an INTERVAL value, the DataBlade API must find a valid qualifier in the mi_interval variable. The DataBlade API takes one of the following actions, based on the value of the in_qual field the intrvl_t structure that is associated with the variable:

Implicit Data Conversion

You can select a DATETIME or INTERVAL column value into a character variable. The DataBlade API converts the DATETIME or INTERVAL column value to a character string before it stores it in the character variable. This character string conforms to the ANSI SQL standards for DATETIME and INTERVAL values.

Important:
IBM Informix products do not support automatic data conversion from DATETIME and INTERVAL column values to numeric (mi_double_precision, mi_integer, and so on) variables.

You can also insert a DATETIME or INTERVAL column value from a character variable. The DataBlade API 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, the DataBlade API 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 numeric and mi_date variables to DATETIME and INTERVAL column values.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]