SQL/MX 3.2.1 Programming Manual for C and COBOL (H06.26+, J06.15+)
Host Variables in C/C++ Programs
HP NonStop SQL/MX Release 3.2.1 Programming Manual for C and COBOL—663854-005
3-5
Date-Time and Interval Host Variables
DATE
specifies the data type of a target host variable for a date-time column that
contains a date in the external form yyyy-mm-dd.
TIME [(n)]
specifies the data type of a target host variable for a date-time column that, without
the optional n precision, contains a time in the external form hh:mm:ss. The n
precision is a positive integer that specifies the number of digits in the fractional
seconds. The default for the precision is 0, and the maximum is 6.
TIMESTAMP [(n)]
specifies the data type of target host variable for a date-time column that, without
the optional n precision, contains a timestamp in the external form:
yyyy-mm-dd hh:mm:ss
The n precision is a positive integer that specifies the number of digits in the
fractional seconds, as shown in bold text:
yyyy-mm-dd hh:mm:ss.msssss
The default for precision is 6, and the maximum is 6.
INTERVAL [period1[(n)] | SECOND [(n[,m])]] [TO period2[(m)]]
where
period1 must be greater or equal time part than period2. YEAR to SECOND is
valid. SECOND to YEAR is invalid.
Specifies a column that represents a duration of time as either a year-month or
day-time range or a single-field. period1 can have a leading-precision up to 18
digits (the maximum depends on the number of fields in the interval). The leading-
precision is the number of digits allowed in period1. If period2 is SECOND, it
can have a fractional-precision up to 6 digits. The fractional-precision is the
number of digits of precision after the decimal point. The default for leading-
precision is 2, and the default for fractional-precision is 6. If the single-field is
SECOND, the leading-precision is the number of digits of precision before the
decimal point, and the fractional-precision is the number of digits of precision after
the decimal point.
n leading precision
m fractional precision
period YEAR | MONTH | DAY | HOUR | MINUTE | SECOND










