Timestamp Datatype


Timestamp Datatype

Hi All,

Can you please explain the concept for timestamp(0),timestamp(1) ....timestamp(6)..?

Thanks in advance for the help.

Tags (1)

Re: Timestamp Datatype

My understanding is the value in the (..) is basically the number of digits for fractions of a second that you want to store. So Timestamp(0) is accurate to the second, Timestamp(1) is accurate to a tenth of a second, etc. Timestamp(6) is the max.

Re: Timestamp Datatype

Thanks for helping out.

Not applicable

Re: Timestamp Datatype


Can you please explain how the timestamp value internally stores?  and how much space timestamp(0) will occupy?

I read below two statements in SQL doc.

1. Timestamp column takes 10 bytes space.

Date --> 4 bytes

Time -->  6 bytes

2. Timestamps represented as character strings must be syntactically precise and may take a maximum of twenty six bytes of storage.

Timestamp Format                                                      Character conversion

TIMESTAMP(0) ‘2001-12-07 11:37:58’                      CHAR(19)

TIMESTAMP(6) ‘2001-12-07 11:37:58.213000’        CHAR(26)

what is the difference between statement1 and statement2?