Start of change

SQL_XML_DATA_CCSID QAQQINI option

The SQL_XML_DATA_CCSID QAQQINI option has several settings that affect SQL processing.

The SQL_XML_DATA_CCSID QAQQINI setting is applied within SQL in the following SQL processing:

Table 1. SQL_XML_DATA_CCSID setting application within SQL
SQL Processing item Description
Valid values for the QAQQINI option are CCSIDs allowed on an XML column. Valid values are all EBCDIC SBCS and mixed CCSIDs, and Unicode 1208, 1200, and 13488 CCSIDs.
Does not affect the promotion of SQL data types. Other SQL data types cannot be directly promoted to the SQL XML data type.
XMLPARSE untyped parameter markers. The QAQQINI setting applies to untyped parameter markers passed as string-expression. The type is CLOB(2G) for SBCS, mixed, and UTF-8 values. The type is DBCLOB(1G) for Unicode 1200 and 13488.
XMLCOMMENT, XMLTEXT, XMLPI untyped parameter markers. The QAQQINI setting applies to untyped parameter markers passed as string-expression. The type is VARCHAR(32740) for SBCS, mixed, and UTF-8 values. The type is VARGRAPHIC(16370) for Unicode 1200 and 13488.
Applies to parameter marker casts to the XML type for XMLCONCAT, and XMLDOCUMENT. Applies to an untyped parameter marker passed as an XML-expression. Unless an explicit CCSID clause is specified, the CCSID of the parameter marker is obtained from the QAQQINI setting.
The QAQQINI setting does not affect storage and retrieval assignment rules. The CCSID of the host variables and table columns apply.
String to column assignment on SQL INSERT and UPDATE. An implicit or explicit XMLPARSE is required on the column assignment.
String to host variable assignment. An implicit or explicit XMLSERIALIZE is required on the host variable assignment.
Column to column assignment. When the target column is XML, an implicit XMLPARSE is applied if the source column is not XML. The target XML column has a defined XML CCSID. When the source column is XML, an explicit XMLSERIALIZE is required if the target column is not XML.
Host variable to column assignment. The target column has a defined CCSID.
UNION ALL (if XML publishing functions in query). The XML result CCSID is obtained from the QAQQINI setting.
Does not apply to SQL constants. UX constants are defined as UTF-16. FX constants are defined as UTF-8.
Result type of XML data built-in functions. If the first operand of XMLPARSE and XMLVALIDATE is an untyped parameter marker, the CCSID is set from the QAQQINI setting, which then affects the XML result CCSID. The QAQQINI setting is used for XMLSERIALIZE for CHAR, VARCHAR, and LOB AS data-type. UTF-16 is used for GRAPHIC, DBCLOB, and NCHAR.
Result type of XML publishing functions - XMLAGG, XMLGROUP, XMLATTRIBUTES, XMLCOMMENT, XMLCONCAT, XMLDOCUMENT, XMELEMENT, XMLFOREST, XMLNAMESPACES, XMLPI, XMLROW, and XMLTEXT. The XML result CCSID for XML publishing functions is obtained from the QAQQINI setting.
Result type of XML publishing functions in a view. The XML result CCSID is set when the view is created.
XML data type on external procedure XML AS parameters. The XML parameter CCSID is set when the procedure is created.
XML data type on external user-defined functions. The XML parameter and result CCSID are set when the function is created.
CREATE TABLE XML column. The QAQQINI setting is used for dynamic SQL. The QAQQINI setting is set in *PGM, *SRVPGM, and *SQLPKG objects when created.
MQTs containing select-statement with XML publishing functions. The CCSID is set when the MQT is created. The CCSID is maintained for an ALTER TABLE.
ALTER TABLE ADD MATERIALIZED QUERY definition. The QAQQINI setting is used if the select-statement contains XML publishing functions.
XML AS CLOB CCSID The QAQQINI setting is built into *PGM and *SRVPGM objects when the program is created. The CCSID defaults to UTF-8 for CLOB when QAQQINI setting is UTF-16 or UCS2.
XML AS DBCLOB CCSID The default for DBCLOB is always UTF-16 for XML.
SQL GET and SET DESCRIPTOR XML data type. QAQQINI setting applied to XML data type.
SQL Global variables. QAQQINI setting applied to global variables with the XML data type.
End of change