The pureXML feature enables well-formed XML documents
to be stored in their hierarchical format within columns of a table. XML columns
are defined with the new XML data type. Because the pureXML feature
is fully integrated into the DB2 database system, the stored XML data can
be accessed and managed by leveraging DB2 functionality. This functionality
includes administration support, application development support and efficient
search and retrieval of XML via support for XQuery, SQL or a combination of
SQL/XML functions.
There are various samples provided to demonstrate the XML support; these
are broadly categorized as:
- Administration samples
- These samples demonstrate the following features:
- XML schema support : Schema registration and validation of XML documents
- XML data indexing support : Indexes on different node types of XML value
- Utility support for XML : Import , export, runstats, db2look, and db2batch
support for the XML data type
- Application Development samples
- These samples demonstrate the following features:
- XML insert, update, and delete : Inserting XML values in XML typed columns,
updating and deleting existing values
- XML parsing, validation, and serialization support : Implicit and explicit
parsing of compatible data types, validating an XML document, serializing
XML data
- Hybrid use of SQL and XQuery : Using SQL/XML functions like XMLTABLE,
XMLQUERY and the XMLEXISTS predicate
- XML data type support in SQL and external procedures: Passing XML data
to SQL and external procedures by including parameters of data type XML
- Annotated XML schema decomposition support : Decomposing an XML document
based on annotated XML schemas
- XML publishing functions : Using functions to construct XML
values
- XQuery samples
- These samples demonstrate the use of axes, FLWOR expressions, and queries
written with XQuery and SQL/XML.
These samples can be found in the following location:
- On Windows: %DB2PATH%\sqllib\samples\xml (where %DB2PATH% is a variable that determines where DB2® database server is installed)
- On UNIX: $HOME/sqllib/samples/xml (where $HOME
is the home directory of the instance owner)