Fetch and insert into datetime host variables
When an application uses a datetime host variable to fetch
or insert a DATETIME value, must
find a valid qualifier in the datetime host variable. 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 host variable:
- When the dt_qual field contains a valid qualifier, 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, takes
different actions for a fetch and an insert:
- For a fetch, uses
the DATETIME column value and its qualifier to initialize the datetime host
variable.
Zero (
0
) is an invalid qualifier. Therefore, if you set the dt_qual field to zero, you can ensure that uses the qualifier of the DATETIME column. - For an insert, cannot
perform the insert or update operation.
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, uses
the DATETIME column value and its qualifier to initialize the datetime host
variable.