|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL: testing for existance in multiple dimensional xml tree |
« View previous topic :: View next topic » |
Author |
Message
|
duffMan |
Posted: Mon Jan 19, 2009 8:49 am Post subject: ESQL: testing for existance in multiple dimensional xml tree |
|
|
 Voyager
Joined: 03 Jun 2002 Posts: 75
|
I have a multidimension repeating structure like;
Code: |
A
B
C = 1
C = 2
C = 9
C = 4
A
B
C = 9
C = 16
A
B
C = 2
|
I want to use a single SELECT statement to test for value of C. (or some other mechanism not involving a CODED nested loop)
In the example above if I test for C=2 I will return TRUE. If I test for C=16 I will return TRUE. If I test for C=7 I return FALSE.
The following SELECT statement isn't valid, but hopefully it gets to point across.
SELECT TRUE
FROM A[].B[] AS T1
WHERE T1.C[] = 2;
Or is there some other wildcard capabilities for arrays that I cannot find?
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jan 19, 2009 3:17 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
duffMan |
Posted: Mon Jan 19, 2009 8:55 pm Post subject: |
|
|
 Voyager
Joined: 03 Jun 2002 Posts: 75
|
not sure that will work as the the 2nd "table" in the join is nested in the 1st and must contain a reference to the parent. I cannot acheive a cartesian product.
Code: |
i.e. select blah
from root.xmlnsc.a[], root.xmlnsc.a[?].b[] as T
where T.c = 2;
|
I need to specify a value for ?. so if i specify say "1" then it'll join a[1].b[] to all the a[]'s. If that makes sense.
anyway I think I go with traversing the tree. that's likely what the Select produces (under the covers) anyway.
thanks. |
|
Back to top |
|
 |
mgk |
Posted: Tue Jan 20, 2009 12:41 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
I believe that nested SELECTs may work, one for all outer A's, one for all B's within each A, and then one for each C within each B.
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|