|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Use xs:dateTime to insert into DB2 table column as TIMESTAMP |
« View previous topic :: View next topic » |
Author |
Message
|
Cogito-Ergo-Sum |
Posted: Tue Mar 01, 2011 1:20 am Post subject: Use xs:dateTime to insert into DB2 table column as TIMESTAMP |
|
|
 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 |
|
 |
kimbert |
Posted: Tue Mar 01, 2011 4:53 am Post subject: |
|
|
 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 |
|
 |
Cogito-Ergo-Sum |
Posted: Tue Mar 01, 2011 4:53 am Post subject: |
|
|
 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 |
|
 |
Cogito-Ergo-Sum |
Posted: Tue Mar 01, 2011 5:04 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|