DECOMPOSE XML DOCUMENT command

The DECOMPOSE XML DOCUMENT command 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 on the schema of all target tables referenced in the set of annotated schema documents.
    • DATAACCESS authority.
  • All of the following privileges:
    • One of the following privileges:
      • DATAACESS authority on the schema or INSERTIN privilege on the schema of the target table, as required for the operation specified in the action file.
      • INSERT privilege on the target table, as required for the operation specified in the action file.
    • and one of the following privileges:
      • SELECTIN, INSERTIN, UPDATEIN, or DELETEIN privilege, or DATAACESS authority, as applicable, on the schema of any table referenced by the db2-xdb:expression or db2-xdb:condition annotation
      • SELECT, INSERT, UPDATE, or DELETE privilege, as applicable, on any table referenced by the db2-xdb:expression or db2-xdb:condition annotation
      Note: If the VALIDATE option is specified, one of the following privileges is required:
      • USAGE on the XML schema
      • DATAACCESS on the database
      • DATAACCESS on the schema

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagramDECOMPOSE XML DOCUMENTxml-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"