My Oracle Support Banner

Select With XmlQuery Returns XMLTYPE Data With CDATA Section Truncated (Doc ID 2208449.1)

Last updated on MARCH 01, 2019

Applies to:

Oracle Database - Enterprise Edition - Version and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.


XMLTYPE data can get corrupted

The data returned by an SQL Query(like xmlserialize) is truncated for XMLTYPE data.

The issue happens when CDATA with a relatively large amount of data (more than 4000 bytes long) that contains multi-byte characters and you have to get "unlucky" and have one of these multi-byte characters land right at the end of an internal physical buffer boundary

For example the xml query result for the CDATA will be
e.g. - incorrect result (notice what has happened to the word “CREATE” – C has been cut out)


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.