DB2 Version 9.7 for Linux, UNIX, and Windows

DECOMPOSE XML DOCUMENT command

This 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:

If the VALIDATE option is specified, USAGE privilege on the XML schema is also required.

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-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"