[xquery-talk] Defining a string array and setting values

John Snelson john.snelson at oracle.com
Fri Jan 4 10:50:26 PST 2008

XQuery is a functional language, which means you won't be able to use 
procedural techniques to write an XQuery program. Setting the value of a 
variable is one of the procedural paradigms which you can't use in XQuery.

You'll need to take a step backwards and find a solution to your problem 
that doesn't involve setting values in an array.


Jayalakshmy K wrote:
> I want to declare a string array and set values to it in a function
> how do i do it using XQuery. Itried using this but it didn't work
> declare variable $errorParam:= "";
>         $errorParam[.= 0] = $x
>         $errorParam[.= 1] = $y
>         $errorParam[.= 2] = $z
>         $errorParam[.= 3] = $w
>         $errorParam[.= 4] = $u

John Snelson, Oracle Corporation
Berkeley DB XML:        http://www.oracle.com/database/berkeley-db/xml
XQilla:                                  http://xqilla.sourceforge.net

More information about the talk mailing list