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 IndexWebSphere Message Broker (ACE) SupportESQL question

Post new topicReply to topic
ESQL question View previous topic :: View next topic
Author Message
jbacskai
PostPosted: Wed Apr 04, 2007 5:44 am Post subject: ESQL question Reply with quote

Apprentice

Joined: 30 Dec 2002
Posts: 26
Location: Hungary

Hi All,

the ESQL guide states:

"You can use the asterisk (*) wildcard character in a path element to match any name. You can also use “*” to specify a partial name. For example, Prefix* matches any name that begins with “Prefix”."

I would like to select the name elements in one step from the following XML

<A>
<B>
<name>Smith</name>
</B>
<C>
<name>Johnson</name>
</C>
...
</A>

using ESQL:

DECLARE ROW1 ROW;

SET ROW1.Rows[] = SELECT I FROM InputRoot.XML.A.*.name AS I;

but It does not work, it just gives back empty result.

Should it work or I should use other ESQL e.g. iteration?

Using prefix* had the same result.

Regards,
Janos
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jefflowrey
PostPosted: Wed Apr 04, 2007 5:57 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

SELECT I.name from InputRoot.XMLNS.A.[] as I;

Or something close.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jbacskai
PostPosted: Thu Apr 05, 2007 1:58 am Post subject: Reply with quote

Apprentice

Joined: 30 Dec 2002
Posts: 26
Location: Hungary

Thanx Jefflowrey for the answer,

but it is applicable on a simple XML, if you have repeating elements on more then one level, then it is not good solution, because you can use [] just at the end of the path.

I found several topic about XPATH, ESQL so we have to use Java compute node to get elements with the same name, but with on different path.

My question is still stands using * in the middle of the path should give or should not give result?

Documentation contains as I wrote, broker toolkit accepts is, and the code is deployable...


Regards,
Janos
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jefflowrey
PostPosted: Thu Apr 05, 2007 3:22 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So what you're saying is you want a simple means to have entirely random access to a tree structure, which by nature is designed for sequential access?

I tihnk you will find, if you look closely, that the * only matches a single element of the path, and not any number of path elemenets.

Solve the problems you need to solve by thinking of the data as trees.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportESQL question
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.