-20306   AN INDEX ON AN XML COLUMN CANNOT BE CREATED BECAUSE OF AN ERROR DETECTED WHEN INSERTING THE XML VALUES INTO THE INDEX. REASON CODE = reason-code

Explanation

The statement cannot proceed and the table remains unchanged. The schema data type and schema identifier are not applicable for all reason codes. See specific reason codes for details. The creation of the index on an XML column failed for one of the following possible reason codes:
1
One or more XML node values in an XML value being inserted or updated exceeds a length constraint imposed by the index that is being created. The index on an XML column is defined to use the SQL type VARCHAR with a specific length specified. The length of one or more XMLPATTERN result values exceeds the user-specified length constraint for the VARCHAR data type.
4
One or more XML node values is a valid XML value but cannot be cast to the index data type for the index being created because of DB2® limitations. DB2 does not support the entire range of XML values.

System action

The statement cannot be processed.

Programmer response

Determine the XMLPATTERN clause from the index definition.
1
Use the XML pattern information to identify the set of matching XML nodes to inspect to determine which string values are beyond the limit of the length constraint specified by the index.
4
Use the XMLPATTERN information to identify the set of matching XML nodes to inspect and compare against the data type specified for the index being created. Determine which node values exceed the range of values supported by DB2 for the index data type.

SQLSTATE

23526