date and timestamp data type lengths
ExorApr 19 2010 — edited Apr 20 2010Hello,
Documentation says the follwing:
DATE: Valid date [...] parameter. The size is fixed at 7 bytes. This data type contains the datetime fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. It does not have fractional seconds or a time zone.
TIMESTAMP [(fractional_seconds_precision)]
Year, [...]parameter. The size is 7 or 11 bytes, depending on the precision. This data type contains the datetime fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. It contains fractional seconds but does not have a time zone.
However if I create a table like follows:
create table t9 (c1 timestamp(3), c2 date);
and do:
insert into t9 values (systimestamp, sysdate);
commit;
select length(c1), length(c2),lengthb(c1), lengthb(c2) from t9;
I get
LENGTH(C1) LENGTH(C2) LENGTHB(C1) LENGTHB(C2)
---------- ---------- ----------- -----------
21 8 21 8
Can someone please explain this to me?
Thank you,