Precision of a date-time or interval data type
For the DATETIME and INTERVAL data types, the precision is the number of digits required to store a value with the specified qualifier.
In Figure 1,
the call to the mi_type_precision() function saves
in type_prec the precision for the dt_col column from
its type descriptor. This precision has a value of 14 because
a DATETIME YEAR TO SECOND value requires 14 digits:
YYYYMMDDHHMMSS
- YYYY
- The 4-digit year.
- MM
- The 2-digit month.
- DD
- The 2-digit day of the month.
- HH
- The 2-digit hour.
- MM
- The 2-digit minute.
- SS
- The 2-digit second.
The DataBlade API also provides functions that obtain DATETIME or INTERVAL precision of a column associated with an input parameter, a UDR argument, UDR return value, or a row column. For a list of these functions, see Table 1.