Author |
Message
|
rmbowma |
Posted: Wed Jul 22, 2009 8:18 am Post subject: SETting a field of datatime data TYPE? |
|
|
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 |
|
 |
jbanoop |
Posted: Wed Jul 22, 2009 9:48 am Post subject: |
|
|
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 |
|
 |
rmbowma |
Posted: Wed Jul 22, 2009 10:30 am Post subject: |
|
|
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 |
|
 |
jbanoop |
Posted: Wed Jul 22, 2009 10:49 am Post subject: |
|
|
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 |
|
 |
rmbowma |
Posted: Wed Jul 22, 2009 11:07 am Post subject: |
|
|
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 |
|
 |
rmbowma |
Posted: Wed Jul 22, 2009 2:26 pm Post subject: |
|
|
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 |
|
 |
|