Author |
Message
|
vetric2k |
Posted: Sat May 25, 2013 1:30 pm Post subject: problemConvertingFrom date to dateTime-Mapping node-v8.0.0.2 |
|
|
Newbie
Joined: 22 May 2013 Posts: 4
|
Dear All,
Facing problem while doing this simple conversion from date from dateTime inside mapping node.
Works great when using plain ESQL but problem exists when using ESQL inside mapping node. Only Timezone portion from dateTime field alone getting truncated.
Incoming Parameter type - xsd:date ('yyyyMMdd')
Return Value expected - xsd:dateTime ('yyyy-MM-dd''T''HH:mm:ssZZZ')
Return value actual - 'yyyy-MM-dd''T''HH:mm:ss'
e.g.,
Incoming Parameter type - 20130525
Return value expected - 2013-05-25T17:10:12-05:00
Return value actual - 2013-05-25T17:10:12
Note: Using a custom ESQL inside for-each. So unable to use date and functions provided by MB for this conversion.
Tried with Custom Java, Custom XPath in place of ESQL but no luck.
Using MB version: 8.0.0.2
Any help would be greatly appreciated. |
|
Back to top |
|
 |
Vitor |
Posted: Sun May 26, 2013 5:18 am Post subject: Re: problemConvertingFrom date to dateTime-Mapping node-v8.0 |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vetric2k wrote: |
Note: Using a custom ESQL inside for-each. So unable to use date and functions provided by MB for this conversion. |
Why not? If
vetric2k wrote: |
Works great when using plain ESQL |
what's the issue within the mapping node? Just that the return value is misformed? Where are you seeing these parameters? Debugger, user trace, downstream node?
Why not just use plain ESQL? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
vetric2k |
Posted: Sun May 26, 2013 10:26 am Post subject: |
|
|
Newbie
Joined: 22 May 2013 Posts: 4
|
Hi Vitor, thanks for the response.
If I use the default functions broker throws with an error saying this function can't be used inside for-each.
I need to iterate through an xml to get the date value.
Quote: |
what's the issue within the mapping node? Just that the return value is misformed? Where are you seeing these parameters? Debugger, user trace, downstream node?
|
Yes on the return value the timezone portion (-05:00) alone getting stripped off.
Return value expected - 2013-05-25T17:10:12-05:00
Return value actual - 2013-05-25T17:10:12
Parameter is used inside the custom ESQL function.
Quote: |
Why not just use plain ESQL?
|
Unfortunately I am forced to use mapping node. I am using ESQL but inside mapping node to handle this date field. |
|
Back to top |
|
 |
goffinf |
Posted: Sun May 26, 2013 10:48 am Post subject: |
|
|
Chevalier
Joined: 05 Nov 2005 Posts: 401
|
Quote: |
I need to iterate through an xml to get the date value.
|
Can't you just point directly at it using XPath ? |
|
Back to top |
|
 |
vetric2k |
Posted: Sun May 26, 2013 11:11 am Post subject: |
|
|
Newbie
Joined: 22 May 2013 Posts: 4
|
Hi goffinf,
Quote: |
Can't you just point directly at it using XPath ? |
Tried with custom XPATH, custom Java from mapper node, but no luck.
As I said unfortunately, I can't come out of mapper node.
Expecting, any possible solutions by using mapper node, from here.
Thanks again. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 27, 2013 1:53 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sounds like you should be using GMTTIMESTAMP where you are using TIMESTAMP.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
vetric2k |
Posted: Mon May 27, 2013 7:19 pm Post subject: |
|
|
Newbie
Joined: 22 May 2013 Posts: 4
|
Hi Saper..
I have checked it. Its only GMTTIMESTAMP.
There is some thing in mapper that blocks me to output timezone. |
|
Back to top |
|
 |
rekarm01 |
Posted: Mon May 27, 2013 8:47 pm Post subject: Re: problemConvertingFrom date to dateTime-Mapping node-v8.0 |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
vetric2k wrote: |
Works great when using plain ESQL but problem exists when using ESQL inside mapping node. Only Timezone portion from dateTime field alone getting truncated. |
The Mapping node seems to use the non-timezone aware ESQL datatypes when converting to/from XML Schema datatypes. It may rely on the implicit (local) timezone.
vetric2k wrote: |
Incoming Parameter type - xsd:date ('yyyyMMdd')
Return Value expected - xsd:dateTime ('yyyy-MM-dd''T''HH:mm:ssZZZ')
Return value actual - 'yyyy-MM-dd''T''HH:mm:ss'
...
Tried with Custom Java, Custom XPath in place of ESQL but no luck. |
Posting some actual code might help. How is an incoming xsd:date mapped into an outgoing xsd:dateTime? |
|
Back to top |
|
 |
|