Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

date and timestamp data type lengths

ExorApr 19 2010 — edited Apr 20 2010
Hello,

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,
This post has been answered by Tubby on Apr 19 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2010
Added on Apr 19 2010
2 comments
1,612 views