Encoding considerations for passing XML data in routine parameters

In a Db2® database system, several XML data types are available for parameters in a stored procedure or user-defined function definition.

The following XML data types are available:
XML
For SQL procedures.
XML AS CLOB
For external SQL procedures and external user-defined functions.

Data in XML AS CLOB parameters is subject to character conversion, if the application encoding is not UTF-8. You should avoid the overhead of character conversion in an external user-defined function or stored procedure. Any application character or graphic data type can be used for the parameters in the calling application, but the source data should not contain an encoding declaration. Additional code page conversion might occur, which can make the encoding information inaccurate. If the data is further parsed in the application, data corruption can result.