ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Use xs:dateTime to insert into DB2 table column as TIMESTAMP

Post new topic  Reply to topic
 Use xs:dateTime to insert into DB2 table column as TIMESTAMP « View previous topic :: View next topic » 
Author Message
Cogito-Ergo-Sum
PostPosted: Tue Mar 01, 2011 1:20 am    Post subject: Use xs:dateTime to insert into DB2 table column as TIMESTAMP Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

Hi,
My requirement is to use an attribute dsTStamp, defined as xs:dateTime in the .xsd, to insert into a DB2 table column defined as TIMESTAMP.

In the .mxsd, under Physical Properties -> XML1 - Local Attribute, the DateTime format is set as yyyy-MM-dd.HH:mm:ss.SSS (as described here). In the .mset, under XML Wire Formats -> XML1, for Datetime settings, 'Use default dateTime format' has been set to yyyy-MM-dd.HH:mm:ss.SSS. And yet, when this attribute has a value in this format (or, in any format other than yyyy-MM-dd'T'HH:mm:ss.SSS), I get a parser exception.

In the DataInsert node, I did see a couple of fn: xs: and esql: functions related to time-stamp. But, I do not think, if these could be used for converting yyyy-MM-dd'T'HH:mm:ss.SSS to yyyy-MM-dd.HH:mm:ss which is agreeable to the database table column.

I did see posts in this forum covering this topic; but, I am not sure, I have a solution yet.

So, in general, what is the way to use xs:dateTime for a timestamp value agreeable to TIMESTAMP DB2 table column ?
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 01, 2011 4:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

- You should be using the XMLNSC parser.
- The XMLNSC parser does not use the XML physical format - that is used only by the MRM parser only.
- XMLNSC writes TIMESTAMP in the XML schema canonical format. If that is not what you need, you can always use the ESQL CAST function with a FORMAT clause. There are some good examples in the infocenter.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Tue Mar 01, 2011 4:53 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

I mapped the target column as follows and it works now.
Code:
esql:replace($source/root/mvsDSNStart/@dsTStamp, 'T', '-')



_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Tue Mar 01, 2011 5:04 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

Hi Tim,
I think, I am using XMLNSC.

Yes, I have used ESQL CAST elsewhere successfully. But, this was in a DataInsert node. And, I don't think, I saw an esql: function equivalent of ESQL CAST.
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Use xs:dateTime to insert into DB2 table column as TIMESTAMP
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.