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 » Using character string to build address in the message tree

Post new topic  Reply to topic
 Using character string to build address in the message tree « View previous topic :: View next topic » 
Author Message
sat_in_field
PostPosted: Mon Dec 20, 2004 3:46 am    Post subject: Using character string to build address in the message tree Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Dec 20, 2004 5:28 am    Post subject: Reply with quote

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
View user's profile Send private message
EddieA
PostPosted: Mon Dec 20, 2004 5:39 am    Post subject: Reply with quote

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
View user's profile Send private message
sat_in_field
PostPosted: Mon Dec 20, 2004 5:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Ramphart
PostPosted: Mon Dec 20, 2004 11:32 pm    Post subject: Re: Using character string to build address in the message t Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Mon Dec 20, 2004 11:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mgk
PostPosted: Tue Dec 21, 2004 2:02 am    Post subject: Reply with quote

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
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 » Using character string to build address in the message tree
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.