Ordering mode declaration
An ordering mode declaration in the query prolog sets the ordering mode for the query. The ordering mode defines the ordering of nodes in the query result.
Because Db2 XQuery does not support ordered mode as defined in XQuery 1.0: An XML Query Language, the ordering mode declaration, if present, must specify unordered. For the rules that govern the order of query results in Db2 XQuery, see Order of results in XQuery expressions.
The query prolog can contain only one ordering mode declaration. An ordering mode declaration that specifies a value other than unordered results in an error.
Syntax
- unordered
- Specifies that the rules for ordered mode in XQuery 1.0: An XML Query Language are not in effect. For the rules that govern the order of query results in Db2 XQuery, see Order of results in XQuery expressions.
Example
The following declaration is valid, but it does not change the default behavior of ordering because Db2 XQuery supports only unordered mode:
declare ordering unordered;