Functions to obtain information on date and time data
The following table shows the DataBlade®
API functions
that obtain qualifier information for a DATETIME (mi_datetime)
or INTERVAL (mi_interval) value.
Source | DataBlade® API functions |
---|---|
For a data type | mi_type_qualifier(), mi_type_precision(), mi_type_scale() |
For a UDR argument | mi_fp_argprec(), mi_fp_setargprec(), mi_fp_argscale(), mi_fp_setargscale() |
For a UDR return value | mi_fp_retprec(), mi_fp_setretprec(), mi_fp_retscale(), mi_fp_setretscale() |
For a column in a row (or field in a row type) | mi_column_precision(), mi_column_scale() |
For an input parameter in a prepared statement | mi_parameter_precision(), mi_parameter_scale() |
Suppose you have a table with a single column, dt_col,
of type DATETIME YEAR TO SECOND. If row_desc is a row descriptor
for a row in this table, the following code fragment obtains the name,
qualifier, precision, and scale for this column value.
In the preceding code fragment, the value in the type_buf buffer
would be as follows:
column=0, type name=datetime year to second, qualifier=3594 precision=14 scale=10