RE: Empty sequences in "for" clause bindings

Thank you for all your answers.
Regards

-----Message d'origine-----
De : www-ql-request@w3.org [mailto:www-ql-request@w3.org]De la part de Jerome Simeon
Envoyé : jeudi 8 juillet 2004 19:43
À : Stéphane Mbaye
Cc : XQuery
Objet : Re: Empty sequences in "for" clause bindings

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 <stephane.mbaye@gael.fr>
Sent by: www-ql-request@w3.org
07/08/2004 12:58 PM

To
"XQuery" <www-ql@w3.org>
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:stephane.mbaye@gael.fr
http://www.gael.fr


tel +33-(0)1 64 73 99 55
fax +33-(0)1 64 73 51 60

Received on Thursday, 8 July 2004 13:55:55 UTC