FORG0006
An invalid argument was used in a function or operation. This can happen in three situations:
You passed an argument sequence to one of the
sumoravgfunctions that contains values that are not numbers or durations, or that are a mixture of numbers and durations.You passed an argument sequence to one of the
minormaxfunctions that contains values that do not support the<and>operators, or that have a mixture of different types.You attempted to find the effective Boolean value of a multi-item sequence whose first item is an atomic value. Effective Boolean value is calculated when calling the
booleanandnotfunctions, but also in many different operations that do not involve functions, such as conditional (if-then-else) expressions,whereclauses of FLWORs, and predicates of path expressions. Effective Boolean value is discussed in more detail in "Effective Boolean Value" in Chapter 11.
One common cause of this is using an expression like:
doc("catalog.xml")//product[1 to 3]Although this expression is allowed by some XQuery processors, it is technically not valid because it attempts to find the effective Boolean value of a sequence of integers. Instead, you should use:
doc("catalog.xml")//product[position( ) = 1 to 3]Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access