SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
Host Variables in C/C++ Programs
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
3-5
Numeric Host Variables
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.
Numeric Host Variables
{[signed] | unsigned} NUMERIC (p, s)
specifies the data type of a target host variable for a column of one of these SQL
data types:
NUMERIC [(p, s)] [SIGNED|UNSIGNED]
PIC[TURE] [S] {9(l-s) [V[9(s)]] | V9(s)} COMP
The precision p corresponds to the precision of the column value. If p is greater
than or equal to 10, the data type must be signed. The scale s corresponds to the
scale of the column value. The length l corresponds to the number of digits in the
column value. The value l-s is the number of digits in the integral part of the
column value.
n leading precision
m fractional precision
period YEAR | MONTH | DAY | HOUR | MINUTE | SECOND