Host Variables
HP NonStop SQL/MP Programming Manual for C—429847-008
2-15
Date-Time and INTERVAL Data Types
INTERVAL values are represented as character strings with a separator between the
values of the fields (year-month or day-time). An extra byte is generated at the
beginning of the INTERVAL string for a sign. The default representations for DATE and
INTERVAL values are shown in these examples.
DATE Representation
The column definition and representation in the table for December 22, 1988 is:
birth_date DATE
If the DATEFORMAT clause on the INVOKE directive specifies DEFAULT, a column
with the range of fields YEAR TO DAY is represented as an 11-character string
(10 characters plus a byte for a null character). The C compiler creates this structure:
struct employee_rec {
char name[18];
char birth_date[11];
};
INTERVAL Representation
The column definition and representation in the table for 36 years, 7 months is:
AGE INTERVAL YEAR(2) TO MONTH
The C compiler creates this structure:
struct employee_rec {
char name[21];
char age[7];
};