pureXML

You can use pureXML® with your client applications to manage XML data in Db2 tables. You can store well-formed XML documents in their hierarchical form and retrieve all or portions of those documents.

Because the stored XML data is fully integrated into the Db2 database system, you can access and manage the XML data by using Db2 functions and capabilities.

To efficiently manage traditional SQL data types and XML data, Db2 uses two distinct storage mechanisms. However, the underlying storage mechanism that is used for a given data type is transparent to the application. The application does not need to explicitly specify which storage mechanism to use, or to manage the physical storage for XML and non-XML objects.

XML document storage
The XML column data type is provided for storage of XML data in Db2 tables. Most SQL statements support the XML data type. This enables you to perform many common database operations with XML data, such as creating tables with XML columns, adding XML columns to existing tables, creating indexes over XML columns, creating triggers on tables with XML columns, and inserting, updating, or deleting XML documents.

Alternatively, a decomposition stored procedure is provided so that you can extract data items from an XML document and store those data items in columns of relational tables, using an XML schema that is annotated with instructions on how to store the data items.

XML document retrieval
You can use SQL to retrieve entire documents from XML columns, just as you retrieve data from any other type of column. When you need to retrieve portions of documents, you can specify XPath expressions, through SQL with XML extensions (SQL/XML).
Application development
Application development support of XML enables applications to combine XML and relational data access and storage. The following programming languages support the XML data type:
  • Assembler
  • C or C++ (embedded SQL or Db2 ODBC)
  • COBOL
  • Java™ (pureQuery®, JDBC, or SQLJ)
  • PL/I
  • pureXML
Database administration
Db2 for z/OS® database administration support for pureXML includes the following items:
XML schema repository (XSR)
The XML schema repository (XSR) is a repository for all XML schemas that are required to validate and process XML documents that are stored in XML columns or that are decomposed into relational tables.
Utility support
Db2 for z/OS utilities support the XML data type. The storage structure for XML data and indexes is like the storage structure for LOB data and indexes. As with LOB data, XML data is not stored in the base table space, but it is stored in separate table spaces that contain only XML data. The XML table spaces also have their own index spaces. Therefore, the implications of using utilities for manipulating, backing up, and restoring XML data and LOB data are similar.
Performance
Indexing support is available for data stored in XML columns. The use of indexes over XML data can improve the efficiency of queries that you issue against XML documents. An XML index differs from a relational index in that a relational index applies to an entire column, whereas an XML index applies to part of the data in a column. You indicate which parts of an XML column are indexed by specifying an XML pattern, which is a limited XPath expression.