Author |
Message
|
sat_in_field |
Posted: Mon Dec 20, 2004 3:46 am Post subject: Using character string to build address in the message tree |
|
|
Novice
Joined: 23 Jan 2003 Posts: 20
|
Hello,
A lookup on a database returns a character string which is an XML reference to a declared varible. This "can" be used as a to find a value in my inbound message tree, how can I use this to get the data from the message tree.
I think something like this but I cannot get it to work, will it ever work? any help would be much appreciated.
Code: |
DECLARE var1 CHAR;
--A select would return this value
SET var1 = 'message.type.account';
--Map input value to the output
SET OutputRoot.XML.message.details = InputRoot.xml.{var1};
|
Many Thanks
Steve |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 20, 2004 5:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
How do you know it doesn't work? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EddieA |
Posted: Mon Dec 20, 2004 5:39 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
I think the {...} syntax can only be used for a single "level". So you would have to break down your return value. InputRoot.{Part1}.{Part2}.{Part3}.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
sat_in_field |
Posted: Mon Dec 20, 2004 5:55 am Post subject: |
|
|
Novice
Joined: 23 Jan 2003 Posts: 20
|
Thanks Eddie,
I have tried as you suggested and it works, I will have to think if this is how I want to code this or if there is another way for me to go about things.
thanks again
Steve |
|
Back to top |
|
 |
Ramphart |
Posted: Mon Dec 20, 2004 11:32 pm Post subject: Re: Using character string to build address in the message t |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
sat_in_field wrote: |
Hello,
--Map input value to the output
SET OutputRoot.XML.message.details = InputRoot.xml.{var1};
|
The EVAL function should work for you. Try something like:
Code: |
SET OutputRoot.XML.message.details = EVAL ('InputRoot.xml.' || var1) |
_________________ Applications Architect |
|
Back to top |
|
 |
kirani |
Posted: Mon Dec 20, 2004 11:41 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Please note that the EVAL statement is costly in terms of performance. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
mgk |
Posted: Tue Dec 21, 2004 2:02 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Just the be pedantic, the example given was showing the EVAL function, not the EVAL statement. The statement form of EVAL contains one (or more) ESQL statements that are EVAL'd, whereas the function form of EVAL contains a single expression that is EVAL'd.
Both are costly in terms of performance though...
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|