I hava a problem with the timestamp format.
In my DB2 database stands the following timestamp format: 2012-12-17 17:02:09.133104
Now I'd like to select this ts, but i get only this value : 2012-12-17 17:02:09.133
So, whats happened to the last three figures?
Thanks in advance
This topic has been locked.
1 reply Latest Post - 2012-12-20T10:16:32Z by SystemAdmin
Pinned topic Problems at selecting a timestamp from DB2
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-12-20T10:16:32Z at 2012-12-20T10:16:32Z by SystemAdmin
SystemAdmin 110000D4XK4179 PostsACCEPTED ANSWER
Re: Problems at selecting a timestamp from DB22012-12-20T10:16:32Z in response to SystemAdminI solved it!
The answer is to cast the timestamp as CHARACTER (cast as TIMESTAMP doesn't work), like that:
SET ts = CAST(exampleTimestamp AS CHARACTER FORMAT 'yyyy-MM-dd HH:mm:ss.SSSSSS');
Cast as CHARACTER:
ts = 2012-12-17 17:02:09.133104;
Cast as TIMESTAMP:
ts = 2012-12-17 17:02:09.133;
Maybe, someone need this solution :)