Specifying Collations
DataDirect XQuery allows collations to be specified in the query, for example, in the query prolog or for a specific order by clause. The specified collation, however, is only used for expressions evaluated by the XQuery engine (see DataDirect XQuery® Architecture).
When DataDirect XQuery accesses a relational database, it uses the collation used by the database. For consistency, ensure that the collation used by DataDirect XQuery (which can be modified as explained below) is compatible with the collation used by the database. If multiple databases are accessed, ensure that their collations are compatible. For relational sources, the collation used by the database overrides any collation specified in the query.
DataDirect XQuery allows you to specify any of the following collations:
http://www.datadirect.com/xquery/collation?class=class_name
where
class_name
is a fully-qualified name of a Java class that implements java.util.Comparator. If the collation will be used in functions such as contains() and starts-with(), this class must also implement java.text.RuleBaseCollator.http://www.datadirect.com/xquery/collation?keyword
=value
[;keyword
=value
]...where the following keywords and values are valid:
DataDirect XQuery uses the collation URI used by the Java Virtual Machine as the default collation. You can change this value using any of the following methods:
- Specifying the collation parameter in the query prolog
- Specifying the Collation property of DDXQDataSource (see DDXQDataSource and DDXQJDBCConnection Properties)