DB2 XQuery concepts
The following topics introduce basic XQuery concepts and
describe how XQuery works with a DB2 database.
Type system
XQuery is a strongly-typed language in which the operands
of various expressions, operators, and functions must conform to expected
types. The type system for DB2 XQuery
includes the built-in types of XML Schema and the predefined types
of XQuery.
Prolog
The prolog is series of declarations that
define the processing environment for a query. Each declaration in
the prolog is followed by a semicolon (;). The prolog is an optional
part of the query; a valid query can consist of a query body with
no prolog.
Expressions
Expressions are the basic building blocks of a query. Expressions
can be used alone or in combination with other expressions to form
complex queries. DB2 XQuery
supports several kinds of expressions for working with XML data.
Built-in functions
DB2 XQuery provides
a library of built-in functions for working with XML data. These built-in
functions include XQuery-defined functions and DB2-defined functions.
Regular expressions
A regular expression is a sequence of characters that act
as a pattern for matching and manipulating strings. Regular expressions
are used in the following XQuery functions: fn:matches, fn:replace,
and fn:tokenize. DB2 XQuery
regular expression support is based on the XML schema regular expression
support as defined in the W3C Recommendation XML Schema Part 2:
Datatypes Second Edition with extensions as defined by W3C Recommendation XQuery
1.0 and XPath 2.0 Functions and Operators.
Limits
DB2 XQuery has size
limits and limits for data types.