DB2 10.5 for Linux, UNIX, and Windows

Document rejection or CREATE INDEX statement failure

For the SQLSTATE 23525 or sqlcode -20305 indexing errors, an XML document is rejected for INSERT or UPDATE statements. For a CREATE INDEX statement on a populated table with XML columns, the CREATE INDEX statement fails (SQLSTATE 23526, sqlcode -20306) and the document remains stored in the table.

VARCHAR(integer) length constraint errors
The length of a resulting index value from one or more XML pattern expressions exceeds the user-specified length constraint for the VARCHAR data type.
Unsupported list data type node error
One or more XML node values in an XML value is a list data type node that cannot be indexed by the specified index. List data type nodes are not supported by indexes over XML data.
Conversion errors
An error is returned if the source value is invalid for the index XML data type and the REJECT INVALID VALUES option was specified with the CREATE INDEX statement. An error is also issued if the source value is a valid XML value which cannot be converted to the DB2® database server representation for either the schema data type or for the index XML data type because of internal DB2 limitations. The error must be issued to maintain consistent results: If a query were to be executed that used the index, the correct result of the query could include a value that exceeds the supported limit since the value would be a valid XML value. To prevent the query from returning an incomplete result, an error is issued to maintain consistent results.
Table 1. Some examples of internal DB2 limitations
XML data type XML schema DB2 range (min : max)
xs:date

No maximum limit for years

Negative dates are supported

0001-01-01:

9999-12-31

xs:dateTime

No maximum limit for years

Negative dates are supported

Arbitrary precision is supported for fractional seconds

0001-01-01T00:00:00.000000Z:

9999-12-31T23:59:59.999999Z

xs:integer No limit on minimum or maximum range

-9223372036854775808:

9223372036854775807

DB2 database server does not support the entire range of XML values. Value ranges that are unsupported include:

  • Date or dateTime values with year > 9999 or < 0
  • Date or dateTime values with fractional second precision > 6 digits
  • Out-of-range numeric values