Posted: Fri Feb 01, 2008 5:02 am Post subject: CURRENT_TIMESTAMP Problems with milliseconds
Acolyte
Joined: 01 Mar 2007 Posts: 62
Hi all,
we are migrating to Message Broker V6.
CURRENT_TIMESTAMP in V5 was in this format:
yyyy-mm-dd hh:mm:ss.fff
Now, in V6 is
yyyy-mm-dd hh:mm:ss.ffffff
And this is a problem for our applications.
This was the code in V5
SET OutputRoot.XMLNS.Header.Timestamp = CURRENT_TIMESTAMP
Output was like this
OutputRoot.XMLNS.Header.Timestamp = '2008-01-10 12:01:20.141'
In v6 the Output is like this
OutputRoot.XMLNS.Header.Timestamp = '2008-01-10 12:01:20.141453'
I need the old format...
So I used this code
CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'yyyy-MM-dd HH:mm:ss.SSS');
It works fine.
But I have a question, can't I use the FORMAT without the CAST?
I'd like a TIMESTAMP in the old format (yyyy-mm-dd hh:mm:ss.fff) without casting. Is it possibile? Or Have I to use this code?
DECLARE target TIMESTAMP;
SET target = CAST(CURRENT_TIMESTAMP AS TIMESTAMP FORMAT 'yyy-MM-dd HH:mm:ss');
If you are using self defined xml you will have to use the cast.
If you are using a message set you should be able to define the format at the element level or at the set level using the element level as an override...
If you are using self defined xml you will have to use the cast.
If you are using a message set you should be able to define the format at the element level or at the set level using the element level as an override...
Enjoy
Yes, I use a self defined XML...
I will use the cast.
thx you.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum