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 of the following actions, based on the value of the dt_qual field
in the dtime_t structure that is associated with the variable:
- When the dt_qual field contains a valid qualifier, the DataBlade
API extends
the column value to match the dt_qual qualifier.
Extending is the operation of adding or dropping fields of a DATETIME value to make it match a given qualifier. You can explicitly extend DATETIME values with the SQL EXTEND function and the dtextend() function.
- When the dt_qual field does not contain a valid qualifier,
the DataBlade
API takes
different actions for a fetch and an insert:
- For a fetch, the DataBlade
API uses
the DATETIME column value and its qualifier to initialize the mi_datetime variable.
Zero is an invalid qualifier. Therefore, if you set the dt_qual field to zero, you can ensure that the DataBlade API uses the qualifier of the DATETIME column.
- For an insert, the DataBlade
API cannot
perform the insert or update operation.
The DataBlade API sets the SQLSTATE status variable to an error-class code (and SQLCODE to a negative value) and the update or insert operation on the DATETIME column fails.
- For a fetch, the DataBlade
API uses
the DATETIME column value and its qualifier to initialize the mi_datetime variable.