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 » SETting a field of datatime data TYPE?

Post new topic  Reply to topic
 SETting a field of datatime data TYPE? « View previous topic :: View next topic » 
Author Message
rmbowma
PostPosted: Wed Jul 22, 2009 8:18 am    Post subject: SETting a field of datatime data TYPE? Reply with quote

Apprentice

Joined: 24 Mar 2005
Posts: 28

I have defined an input message definition that will be used by the MRM/TDS parser. In this definition I have field A defined as date Type and field B defined as time Type.

I have also defined an output message definition that will also be used by the XMLNSC parser. In this definition I have a field C defined as datetime Type.

I want to to move the values in field A and B to field C. What are the ESQL statements to do this? I've barely worked with date and time Types and never with datetime Type.
Back to top
View user's profile Send private message
jbanoop
PostPosted: Wed Jul 22, 2009 9:48 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

Are you using MRM to model both input and output ?
If so , then a direct assignment from input (in which the fields are already interpreted as date/time types by virtue of your input msg set) to the output fields (which are also defined as date/time by the output message definition) should be sufficent.

By
Quote:
I have also defined an output message definition that will also be used by the XMLNSC parser
do you mean that you have modelled an output message set using MRM-XML ?
Back to top
View user's profile Send private message Yahoo Messenger
rmbowma
PostPosted: Wed Jul 22, 2009 10:30 am    Post subject: Reply with quote

Apprentice

Joined: 24 Mar 2005
Posts: 28

For the input message I have created a TDS Wire Format. I use the MRM parser to parse the message.

For the output message I created a separate msg definition and have created a XML Wire Format in it. I use the XMLNSC parser to output the message.

I don't think setting field C's datetime value is as simple as (pseudo) coding:

SET C = A; /* Move A's date value to C's datetime Type */
SET C = B; /* Move B's time value to C's datetime Type */
Back to top
View user's profile Send private message
jbanoop
PostPosted: Wed Jul 22, 2009 10:49 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

did you try doing it ? what error did you receive ? what does the traces show ?
WMB works with the logical message within a message flow. So when the input message is parsed at the input node, the fields will be interpreted as date/time fields. Now any mapping that occurs within the flow is done to the logical message tree. It is only when the output message is written out that wireformats come into the picture.

So if your input message set already allowed the broker to parse those fields as date/time, then the mapping should be just direct (since you would be mapping an MB date/time type to another MB date/time type)
The wireformat specs will be used by the broker when the message is actually written out.
Back to top
View user's profile Send private message Yahoo Messenger
rmbowma
PostPosted: Wed Jul 22, 2009 11:07 am    Post subject: Reply with quote

Apprentice

Joined: 24 Mar 2005
Posts: 28

Thanks for you comments but they are not quite accurate.

Field A is defined as only a date Type.

Field B is defined as only a time Type.

Field C is defined as a DATETIME Type.

I haven't tried:

SET C = A;
SET C = B;

because I'm not confident it will work.

What I'm going to try is:

SET C = CAST (A, B AS TIMESTAMP);

and will report back here.
Back to top
View user's profile Send private message
rmbowma
PostPosted: Wed Jul 22, 2009 2:26 pm    Post subject: Reply with quote

Apprentice

Joined: 24 Mar 2005
Posts: 28

Just to close out this discussion string, my idea of coding:

SET C = CAST (A, B AS TIMESTAMP);

worked.

After executing the above statement, C contains the date and time value from A and B.
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 » SETting a field of datatime data TYPE?
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.