XML data encoding
The encoding of XML data can be derived from the data itself, which is known as internally encoded data, or from external sources, which is known as externally encoded data.
The application data type that you use to exchange the XML data between the application and the XML column determines how the encoding is derived.
- XML data that is in character or graphic application data types is considered to be externally encoded. Like character and graphic data, XML data that is in these data types is considered to be encoded in the host variable declared CCSID.
- XML data that is in a binary application data type or binary data that is in a character data type is considered to be internally encoded.
Externally coded XML data might contain internal encoding, such as when an XML document in a character data type contains an encoding declaration. Externally encoded data sent to a DB2® database is checked by the database manager for internal encoding.
The effective CCSID that is associated with the internal encoding must match the external encoding; otherwise, an error occurs.