DB2 v10 Changes for Timestamp

DB2 V10- Time stamp will have Date, Time and GMT+xx.xx  This is a new change. In prior DB2 releases, the stored representation of a timestamp column was always 10 bytes, and it contained precision to a six-digit microsecond.

You can now control the number of digits in the fractional second up to 12. The precision attribute range is now from 1 to 12, with the default value still 6.

For example:

       (ID INTEGER , 
           COLA_TMS TIMESTAMP, -- default 
           COLB_TMS TIMESTAMP(0), -- minimum
           COLC_TMS TIMESTAMP(6), -- same as default 
           COLD_TMS TIMESTAMP(9), -- precision 9 
           COLD_TMS TIMESTAMP(12) -- precision 12 picoseconds );

Formerly, the stored length of a timestamp was always 10 bytes.

Now in V10, these definitions vary from 7 bytes with no precision to 13 bytes with a precision of 12.

This greater precision may become useful when a timestamp is used as part of a unique key, reducing the chances of duplicates.

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.