List Info

Thread: Two Variables for Collection Unions




Two Variables for Collection Unions
user name
2006-07-27 06:55:54
Hello.

Is it possible to construct joins using a collection union
with two
variables?

If we have:

query 'for $i in (collection("mycoll1.dbxml") |
collection("mycoll2.dbxml"))/Root/Node1

instead of returning $i for both containers:

return($i/data/text(), $i/data/text())

is it possible to declare $x some way, somewhere and return
it? As in:

return($i/data/text(), $x/data/text())

Thanks,
Abdalla Alothman


------------------------------------------
To remove yourself from this list, send an
email to xml-unsubscribesleepycat.com

Two Variables for Collection Unions
user name
2006-07-27 08:13:28
Abdalla Alothman wrote:
> query 'for $i in
(collection("mycoll1.dbxml") |
collection("mycoll2.dbxml"))/Root/Node1
> 
> instead of returning $i for both containers:
> 
> return($i/data/text(), $i/data/text())
> 
> is it possible to declare $x some way, somewhere and
return it? As in:
> 
> return($i/data/text(), $x/data/text())

I'm not sure what you're trying to do.

What would you like $x to be? Are you trying to run the same
query 
(/Root/Node1/.../data/text()) against the two collections
independently 
and return two independent result sets, one for $i and one
for $x?

$x can be declared using let statements (let $x := ...), but
because of 
the functional nature of XQuery there are some restrictions
on this.

~Chris


------------------------------------------
To remove yourself from this list, send an
email to xml-unsubscribesleepycat.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )