Author |
Message
|
JohnMichael |
Posted: Fri Nov 16, 2007 1:37 am Post subject: Dynamically setting output message propagation |
|
|
 Acolyte
Joined: 28 Feb 2007 Posts: 55
|
Hello All,
I am working on Message Broker 6.0 on windows xp machine.
I am working on a scenario where there is a need to set output propagation dynamically.
for propagating to output terminal, we use esql statement as
set OutputRoot.XML.ROOT.CHILD.SUBCHILD..........= 'SOME VALUE';
Now what is needed in my scenario is that I want to get the ROOT tag dynamically from database and set the output root.
let us consider that I want to propagate statement like this.
set databasevalue = 'OutMessage.date';
set OutputRoot.XML.databasevalue = CURRENT_TIMESTAMP;
so should i give in databasevalue place....
desired output----
<OutMessage><date>04.02.05 13:00:00</date></OutMessage>
when I am propagating, it is getting error "failed to locate constant" |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 16, 2007 2:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please post the full error message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shalabh1976 |
Posted: Fri Nov 16, 2007 3:25 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Use the EVAL statement. Please be aware of performance implications. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
sourdas2 |
Posted: Fri Nov 16, 2007 3:56 am Post subject: |
|
|
 Voyager
Joined: 21 Apr 2006 Posts: 90 Location: Kolkata,India
|
syntax would be
Code: |
set OutputRoot.XML.{databasevalue} = CURRENT_TIMESTAMP; |
_________________ Thanks and Warm Regards
Sourav |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 16, 2007 4:27 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sourdas2 wrote: |
syntax would be
Code: |
set OutputRoot.XML.{databasevalue} = CURRENT_TIMESTAMP; |
|
This only works for one level of the tree. So it won't work for "OutMessage.date", it will only work for "OutMessage" or "date".
A reference, on the other hand, could be used. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JohnMichael |
Posted: Fri Nov 16, 2007 4:40 am Post subject: |
|
|
 Acolyte
Joined: 28 Feb 2007 Posts: 55
|
Thank u I got the issue solved by using
EVAL('SET OutputRoot.XML.' || databaseValue || '=' || CAST(dt AS CHAR) ); |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 16, 2007 5:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
shalabh1976 wrote: |
Please be aware of performance implications. |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EddieA |
Posted: Fri Nov 16, 2007 1:26 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
jefflowrey wrote: |
This only works for one level of the tree. So it won't work for "OutMessage.date", it will only work for "OutMessage" or "date".
|
But there's nothing to stop you using {} twice:
Code: |
SET OutputRoot.XML.{OutMessage}.{date}; |
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|