EasyManua.ls Logo

HP NonStop SQL/MP - Page 49

HP NonStop SQL/MP
331 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Host Variables
HP NonStop SQL/MP Programming Manual for C429847-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];
};
012
1
9
8
8
1
2
2
2
Year
Separator
Month
Day
Null
013
+
3
6
0
7
Sign
Year
Separator
Month
Null

Table of Contents

Related product manuals