Version declaration

A version declaration appears at the beginning of a query to identify the version of the XQuery syntax and semantics that are needed to process the query. The version declaration can include an encoding declaration, but the encoding declaration is ignored by Db2 XQuery.

If present, the version declaration must be at the beginning of the prolog. The only version that is supported by Db2 XQuery is "1.0".

Syntax

Read syntax diagramSkip visual syntax diagramxquery version"1.0"encodingStringLiteral;
1.0
Specifies that version 1.0 of the XQuery syntax and semantics is needed to process the query.
StringLiteral
Specifies a string literal that represents the encoding name. Specifying an encoding declaration has no effect on the query because the value of StringLiteral is ignored. Db2 XQuery always assumes the encoding is UTF-8.

Example

The following version declaration indicates that the query must be processed by an implementation that supports XQuery Version 1.0:

xquery version "1.0";