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 » Adding a variable number of days to a Timestamp

Post new topic  Reply to topic
 Adding a variable number of days to a Timestamp « View previous topic :: View next topic » 
Author Message
Galichet
PostPosted: Fri Jul 27, 2001 7:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolban
PostPosted: Fri Jul 27, 2001 11:02 am    Post subject: Reply with quote

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:

<br /> <MSG><MYDATE>2001-07-28 13:51:46.014999</MYDATE></MSG> <br />

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
View user's profile Send private message
Galichet
PostPosted: Sun Jul 29, 2001 1:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Galichet
PostPosted: Sun Jul 29, 2001 2:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolban
PostPosted: Sun Jul 29, 2001 3:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Galichet
PostPosted: Mon Jul 30, 2001 11:14 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Adding a variable number of days to a 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.