Using DATETIME or INTERVAL Data Types

If you set the TYPE field for a DATETIME or INTERVAL value, the DATA field can be a DATETIME or INTERVAL literal or a character string. If you use a character string, the LENGTH field must be the encoded qualifier value.

To determine the encoded qualifiers for a DATETIME or INTERVAL character string, use the datetime and interval macros in the datetime.h header file.

If you set DATA to a host variable of DATETIME or INTERVAL, you do not need to set LENGTH explicitly to the encoded qualifier integer.