XQuery – position Function
The position function is used in FLOWR expression to get the position of an item in a sequence. Syntax position() Example XQuery Expression let $items := (1,2,3,4,5,6) return <result> <items> { for…
The position function is used in FLOWR expression to get the position of an item in a sequence. Syntax position() Example XQuery Expression let $items := (1,2,3,4,5,6) return <result> <items> { for…
The last function is used to get the last item in the given sequence. Syntax last() Example XQuery Expression let $items := (1,2,3,4,5,6) let $lastElement := $items[last()] return <result> <lastElement>{$lastElement}</lastElement> </result> Output…
The index-of function is used to track items in the given sequence. It returns integers to indicate the availability of items in a given sequence. Syntax index-of($seq as anyAtomicType()*, $target as anyAtomicType())…
The reverse function is used to reverse the given sequence. This function returns the modified sequence but the original sequence is not altered. Syntax reverse($seq as item()*) Input Parameters $seq − provided sequence.…
The remove function is used to remove an item in a given sequence from any position. This function returns the modified sequence but the original sequence is not altered. Syntax remove($seq as…
The insert-before function is used to insert an item in a given sequence at any position. This function returns the modified sequence but the original sequence is not altered. Syntax insert-before($seq as…
The subsequence function is used to get the sequence containing requested items present in a given sequence. Syntax subsequence($seq as item()*, $startingLoc as xs:double, $length as xs:double) Input Parameters $seq − provided sequence.…
The distinct-values function is used to get the sequence containing unique items present in a given sequence. Syntax distinct-values($seq as item()*) Input Parameters $seq − provided sequence. A sequence can contain 0 or…
The max function is used to get the maximum valued item present in a sequence. Syntax max($seq as item()*) Input Parameters $seq − provided sequence. A sequence can contain 0 or more items.…
The min function is used to get the minimum valued item present in a sequence. Syntax min($seq as item()*) Input Parameters $seq − provided sequence. A sequence can contain 0 or more items.…