HP NonStop SQL/MP Programming Manual page 49

For c
Table of Contents

Advertisement

Host Variables
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
Year
1
9
8
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
Sign
Year
+
3
6
The C compiler creates this structure:
struct employee_rec
char name[21];
char age[7];
};
HP NonStop SQL/MP Programming Manual for C—429847-008
Separator
Month
8
1
Separator
Month
0
7
{
2-15
Date-Time and INTERVAL Data Types
Separator
Day
2
2
Null
013
Null
2
012

Advertisement

Table of Contents
loading

Table of Contents