Author |
Message
|
Galichet |
Posted: Fri Jul 27, 2001 7:32 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
I've in an input XML message a field containing a number of days.
I want to have in an XML outputfield a timestamp containing the Current_date + the number of days contained in the input field.
Something like that is shown in the documentation :
set OutputRoot.XML.MSG.MYDATE = CURRENT_TIMESTAMP + INTERVAL '1' DAY;
My problem is that I cannot find a syntax accepted by MQSI to specify my input field instead of '1' ...
I've tried to cast my input field in different formats without success, I've tried to define a variable but it doesn't help...
How can I solve this problem ? |
|
Back to top |
|
 |
kolban |
Posted: Fri Jul 27, 2001 11:02 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Interesting, using exactly your ESQL statement (no changes) on MQSI V2.0.2 on Windows 2000, all worked and my output message contains:
2001-07-28 13:51:46.014999
Note: the BR tags are put in by this forum software
I also ran this on:
2001-07-27 13:51:46 ...
[ This Message was edited by: kolban on 2001-07-27 12:03 ] |
|
Back to top |
|
 |
Galichet |
Posted: Sun Jul 29, 2001 1:58 pm Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
Hi,
Yes indeed the following line works well :
set OutputRoot.XML.MSG.MYDATE = CURRENT_TIMESTAMP + INTERVAL '1' DAY;
Maybe I haven't been clear..
My input format is :
2
How can I use the value contained in this XML message to add it to the current timestamp ?
I've tried the following ESQL but there is a syntax error ... :
Set OutputRoot.XML.MSG.MYNEWDATE = CURRENT_TIMESTAMP + INTERVAL InputRoot.XML.MSG.NBDAYS DAYS;
Thanks for your help
_________________ Eric Galichet
SMABTP
France |
|
Back to top |
|
 |
Galichet |
Posted: Sun Jul 29, 2001 2:00 pm Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
oh, my input format was not shown
My input format is :
--> < MSG >< NBDAYS >2< /NBDAYS >< /MSG >
How can I use the value contained in this XML message to add it to the current timestamp ?
I've tried the following ESQL but there is a syntax error ... :
Set OutputRoot.XML.MSG.MYNEWDATE = CURRENT_TIMESTAMP + INTERVAL InputRoot.XML.MSG.NBDAYS DAYS;
Thanks for your help
_________________
Eric Galichet
IBM Global Services
France
[ This Message was edited by: Galichet on 2001-07-29 15:01 ] |
|
Back to top |
|
 |
kolban |
Posted: Sun Jul 29, 2001 3:04 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Eric, Sorry ... my goof, should have read your original question better... here is the answer ...
set OutputRoot.XML.MSG.MYDATE = CURRENT_TIMESTAMP + CAST(InputRoot.XML.MSG.NBDAYS AS INTERVAL DAY); |
|
Back to top |
|
 |
Galichet |
Posted: Mon Jul 30, 2001 11:14 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
Thank you very much that's it
I had tried to cast it, but the syntax I had used was incorrect.
_________________ Eric Galichet
SMABTP
France |
|
Back to top |
|
 |
|