Help: DATETIME ?
Posted in 1994
Topics: General Discussion
I need to know how "DATETIME year to second" is stored ?
The product I am using is INFORMIX-SE 5.01 on SCO UNIX rel.3.2v4.2.
If I use DB-Access and do the following:
create table dtest
(datetime DATETIME year to second);
insert into dtest value ("0001-01-01 05:07:00");
insert into dtest value ("1994-02-01 01:02:00");
select * from dtest;
0001-01-01 05:07:00
1994-02-01 01:02:00
Everything works fine, as expected.
Here is the problem:
If I use 'hd' or 'od' to check what was stored on the disk:
hex dec
c6 01 01 01 05 07 00 00 198 01 01 01 05 07 00 00
c7 13 5e 02 01 01 02 00 199 19 94 02 01 01 02 00
I can't figure out where those c6 and c7 come from and what do they mean?
In the first example, the year requires only 2 bytes (c6 01), and in the
second the year requires 3 bytes (c7 13 5e).
Informix Guide to SQL says that YEAR to SECOND qualifier requires a total of
14 digits(4 for year,2 for month,2 for day,2 for hour, 2 for minute, and 2
for second). This data value requires 8 bytes (14/2+1) of storage, which seems
to be correct.
The database, which is on SCO unix box, is read by DOS clients using SQL, and
by unix programs using C-ISAM. That is the reason why I have to know how
DATETIME is stored.
Any help will be appreciated.
--
tero@clinet.fi