Re: Empty sequences in "for" clause bindings
Jerome Simeon <[email protected]> Thu, 8 Jul 2004 13:43:17 -0400
| Newsgroups | gmane.comp.web.query-languages |
|---|---|
| Message-ID | <OFE4951F94.FBDF051B-ON85256ECB.0060F69E-04256ECB.006158FF@us.ibm.com> |
Stephane, The result of your query is the empty sequence. Variables in for expressions always bind to each items in the input sequence. Since the input sequence here is empty, the $a variable is never bound to anything (it is *not* bound to the empty sequence) and the outermost for expression never executes the left-hand side sub-expression. Best, - Jerome Stéphane Mbaye <[email protected]> Sent by: [email protected] 07/08/2004 12:58 PM To "XQuery" <[email protected]> cc Subject Empty sequences in "for" clause bindings Dear all, how “for” clause tuples are generated when some of the bounded variables match the empty sequence ? For example should the following query return (1, 2, 3), an error or anything else ? for $a in (), $b in (1, 2, 3) return ($a, $b) Regards Stéphane Mbaye GAEL Consultant Cité Descartes 18, rue Albert Einstein 77420 Champs-sur-Marne France Software Director mailto:[email protected] http://www.gael.fr tel +33-(0)1 64 73 99 55 fax +33-(0)1 64 73 51 60