View previous topic :: View next topic
|
Author |
Message |
Priyesh Tewari
New User
Joined: 24 Jun 2008 Posts: 7 Location: Pune
|
|
|
|
Hi,
While I am using a query in SPUFI
SELECT TBNAME, NAME, COLTYPE, NULLS, COLNO, LENGTH FROM SYSIBM.SYSCOLUMNS WHERE TBNAME LIKE 'ABC'.
For the columns Date and time stamp the length that this query is returning is 4 and 10 bytes respectively but actaully the length is 10 bytes for Date field and 26 bytes for timestamp. Can soemboddy help in retrieveing the length of the columns as they appear in the table using the SYSIBM.SYSCOLUMNS table. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Check the Internal representation of date/time/timestamp in DB2 table |
|
Back to top |
|
|
Priyesh Tewari
New User
Joined: 24 Jun 2008 Posts: 7 Location: Pune
|
|
|
|
PeD wrote: |
Check the Internal representation of date/time/timestamp in DB2 table |
Hi,
I wanted the result in the spufi by using some query that it gives me the exact result.
TIA |
|
Back to top |
|
|
Succor
New User
Joined: 20 Feb 2009 Posts: 96 Location: Bangalore :)
|
|
|
|
Priyesh Tewari,What you are getting is correct.
A DATE column will use 4 bytes ,a TIME column will use 3 bytes of storage and a TIMESTAMP column always requires 10 bytes of storage.
Though the external representation of a timestamp uses 26 bytes, the time data uses 8 bytes and the date uses 10 bytes.
WTF. |
|
Back to top |
|
|
|