Compare XML features in DB2 9 and DB2 v8.x _DB2

Source: Internet
Author: User
Tags db2 object model xslt xquery
The DB2 tutorial you are looking at is: Compare the XML features in DB2 9 and DB2 v8.x.

Brief Introduction
XML in the DB2 UDB Version 8.x supports a relational infrastructure based on DB2. The XML data is either stored as a character large object (CLOB) or decomposed into a relational table. On the other hand, the DB2 UDB Viper has real XML data native support. Now, the XML data is processed as a new data type, stored in a parsed and annotated tree that is separate from the relational data store. XML-Schema based xml-based indexing technology is also introduced, and XQuery and Sql/xml are supported as the language for querying and publishing XML data.

XML Support in the DB2 UDB Version 8.x

DB2 8.x uses sql/xml and DB2 XML Extender to provide XML functionality to the underlying relational data. The DB2 XML Extender provides many user-defined types (UDT), user-defined functions (UDF), and stored procedures to support XML. XML documents are stored in relational form and use XML Extender infrastructure to provide XML representations for relational data. Some sql/xml functions are also supported for publishing relational data as XML. More details can be found on the DB2 XML Extender Web site.

DB2 also allows you to create user-defined Java functions and stored procedures that incorporate XML and XSL parsers (installed as part of DB2 8.x) into your code.

XML support in DB2 Viper

DB2 Viper supports native XML storage, eliminating the need to decompose XML into relational tables for querying and publishing. This new storage method saves XML as a parsed and annotated tree form similar to the XML Document Object Model (DOM). For applications that still need to decompose XML data into relational tables, this release also provides enhanced decomposition functionality, which uses annotated XML schema mappings.

XML features contrast--db2 UDB Version 8.x and DB2 Viper

Table 1. XML features contrast--db2 UDB Version 8.x and DB2 Viper



DB2 UDB Version 8.x DB2 Viper storage and indexing

XML data is stored in two different forms:

Document as is:

    • XML Extender columns of the Xmlclob, Xmlvarchar, and XMLFILE types.
    • A BLOB, CLOB, or VARCHAR type of column.
    • Creates an indirect index of an XML document in a relational secondary table.
    • Resolves the document to update the created secondary table.
Decomposed into relational XML Extender (XML collection):
    • Use the document Access definition (DAD) to decompose to an existing relational table.
    • Only leaf nodes in XML can be decomposed and mapped to SQL column types.
    • Namespaces are not supported.
    • Limited functionality and cannot handle complex XML documents.
XML data is stored in two different forms:

Native document XML Store as is.
    • New hierarchical (native) storage is built from scratch. This type of storage saves any tree form of the document.
    • The columns of the XML type.
    • Creates an XML index using the path expression of a leaf node.
    • The document is parsed when it is inserted.
The relational Sql/xml function and the annotated pattern map are decomposed.
    • Decomposes to an existing relational table using annotated XML schema mappings.
    • XML fragments can also be decomposed and mapped to XML column types.
    • Handles namespaces.
    • You can use extended functionality to filter XML data, such as DB2 expressions and conditions.
Verify
    • Implicit validation as defined in DAD.
    • Use XML Extender UDF svalidate for explicit validation.
    • Document type definition (DTD) is registered and stored in the internal table.
    • Get the XML schema from the file system.
    • There is no implicit validation associated with the column.
    • Use the Sql/xml function xmlvalidate for explicit validation.
    • DTD validation is not supported.
    • The DTD and XML schemas are registered in the XML Schema Repository (XSR) and stored in the database.
Query and publish

Query and publish using the Sql/xml and XML Extender functions.

For an XML document that is intact.
    • Use the secondary table with the index to query the document and obtain the document in CLOB form.
    • You can use the XML Extender function for child document queries.
You can use the Extender function for XSLT transformations.

For XML data that is decomposed into relational tables.
    • Sql/xml publish function.
    • XML Extender DAD mappings and functions.
Query and publish using Sql/xml and XQuery.

For an XML document that is intact.
    • You can use Sql/xml and XQuery to retrieve and publish relational data and XML data in a mix.
    • You can join multiple XML columns.
Use XML Extender XSLT functions to support XSLT.
    • You can use XQuery to query, transform, and publish XML.
For XML data that is decomposed into relational tables.
    • Sql/xml publish function.
Updates the XML document for the original.
    • Use SQL UPDATE statements for Full-text document updates.
    • Update using the XML Extender UDF update.
For an XML document that is intact.
    • Use SQL UPDATE statements for Full-text document updates.
    • Subdocument updates are not supported because the criteria for defining XQuery updates are missing.
    • You can download the update stored procedures from DeveloperWorks, refer to the XML application migration from DB2 8.x to DB2 Viper, part 1:partial updates to XML docume NTS in DB2 Viper (developerworks,2006 year May).
Enabling XML functionality for a database requires the XML Extender feature to be enabled for the database. You do not need to enable the database, because XML support is now an intrinsic part of the DB2 engine. The tool does not have integrated XML support in DB2 Development Center or control center.

Websphere Studio Application Developer
    • XML Schema Editor
    • DTD Editor
    • DAD Mapping Tools
    • SQL XML is not supported in the Query Builder.
    • Xerces and Xalan parsers
    • Support is not available in the Java Database connectivity (JDBC) driver.
XML support is integrated into all aspects of the tool.

DB2 control Center and DB2 develope

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] Next

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.