Invokes a stored procedure to decompose a single XML document
using a registered and decomposition-enabled XML schema.
Authorization
One of the following groups of privileges or authorities is required:
- One of the following authorizations:
- CONTROL privilege on all target tables referenced in the set of
annotated schema documents
- DATAACCESS authority
- All of the following privileges:
- INSERT privileges on the target table, as required for the operation
specified in the action file
- SELECT, INSERT, UPDATE, or DELETE privilege, as applicable, on
any table referenced by the db2-xdb:expression or db2-xdb:condition annotation
If the VALIDATE option is specified, USAGE
privilege on the XML schema is also required.
Required connection
Database
Command syntax

>>-DECOMPOSE XML DOCUMENT--xml-document-name-------------------->
>--XMLSCHEMA--xml-schema-name--+----------+--------------------><
'-VALIDATE-'
Command parameters
- DECOMPOSE XML DOCUMENT xml-document-name
- xml-document-name is the file path and file
name of the input XML document to be decomposed.
- XMLSCHEMA xml-schema-name
- xml-schema-name is the name of an existing
XML schema registered with the XML schema repository to be used for document decomposition. xml-schema-name is a qualified SQL identifier consisting of an optional SQL schema
name followed by a period and the XML schema name. If the SQL schema
name is not specified, it is assumed to be the value of the DB2® special register CURRENT SCHEMA.
- VALIDATE
- This parameter indicates that the input XML document is to be
validated first, then decomposed only if the document is valid. If VALIDATE is not specified, the input XML document will
not be validated before decomposition.
Examples
The following
example specifies that the XML document ./gb/document1.xml is to be validated and decomposed with the registered XML schema
DB2INST1.GENBANKSCHEMA.
DECOMPOSE XML DOCUMENT ./gb/document1.xml
XMLSCHEMA DB2INST1.GENBANKSCHEMA
VALIDATE
The following example specifies
that the XML document ./gb/document2.xml is to
be decomposed without validation with the registered XML schema DB2INST2."GENBANK
SCHEMA1", on the assumption that the value of the DB2 special register CURRENT SCHEMA is set to
DB2INST2.
DECOMPOSE XML DOCUMENT ./gb/document2.xml
XMLSCHEMA "GENBANK SCHEMA1"