The INTERVAL data type
The SQL INTERVAL data type holds the internal (binary) format of an interval value. It encodes a value that represents a span of time. INTERVAL types are divided into two classes: year-month intervals and day-time intervals. A year-month interval can represent a span of years and months, and a day-time interval can represent a span of days, hours, minutes, seconds, and fractions of a second.
typedef struct intrvl {
short in_qual;
dec_t in_dec;
} intrvl_t;
- in_qual
- The qualifier of the interval value
- in_dec
- The digits of the fields of the interval value
This field is a decimal value.
The DataBlade API supports the SQL INTERVAL data type with the mi_interval data type. Therefore, an mi_interval data type holds the binary representation of an interval value.
Values of the mi_interval data type cannot fit into an MI_DATUM structure. They must be passed by reference within C UDRs.
All data types, including mi_interval, must be passed by reference within client LIBMI applications.
- Conversion functions
- Arithmetic-operation functions