Product Overview

To set the stage for the comparison of DataDirect XQuery and Oracle XQuery, the relevant product features are highlighted.

Detailed DataDirect XQuery information is available from the documentation and other sources on our website, XQuery.com. Detailed Oracle information is available in the Oracle documentation and accompanying technical documents.


DataDirect XQuery

DataDirect XQuery is a Java implementation of XQuery that does not require any other product or application server, and has no server of its own. It can be used to transparently query and integrate XML information originating from different sources including XML files or streams (for example, through an HTTP connection with a web (service) client or server). Furthermore, through tight integration with the DataDirect XML Converters, a wide range of text and binary non-XML file formats are supported (for example, csv and EDI). Finally, DataDirect XQuery has strong support for data stored in relational databases, currently supporting different versions of Oracle, Sybase, Microsoft SQL Server and DB2.

Besides the pure W3C XQuery features, DataDirect XQuery comes with a number of useful extensions that support the invocation of Java or RDBMS external functions, including RDBMS functions that query natively stored XML information.

To support the data sources listed above, DataDirect XQuery uses standard W3C XQuery syntax. The doc function is used to access XML files or streams and the data sources supported through the DataDirect XML Converters. The collection function is used to access relational data.

Oracle 10g Release 2

Introduction

Oracle started out as a relational database system, and more than 20 years after its first appearance on the market, the main product focus is still the typical features of a high-end relational database management system (RDBMS). Nevertheless, to cope with market trends, a number of non-relational features have been added to the system. Oracle 8 (1997) introduced object relational features and four years later Oracle 9i added XML storage and limited XPath 1.0 query facilities to the list of supported technologies. The latest version, Oracle 10g R2 (2005), introduces XQuery support.

The Oracle XML features are roughly split into two related and integrated groups of tools: the XML Developer's Kit (XDK) and Oracle XML DB, both of which are discussed in more detail below.

There is also a third group of pre-release XML tools. These are available from the Oracle Technology Network web site and include a StAX (pull) XML parser.

Finally, there is also a component called Oracle XML Query services that started out as a pre-release XML tool but was upgraded and is now an integral part of Oracle Application Server release 10g Release 3. It is positioned as an XML data integration tool with XQuery support.

Oracle XML Developer's Kit

The XML Developers Kit (XDK) is documented in “Oracle® XML Developer's Kit Programmer's Guide”. It contains a number of XML technologies that can be used outside the database engine.

The group includes a DOM and SAX XML parser, an XSLT engine, an XML Schema processor, a JAXB implementation, and more. The complete list can be found in the Oracle XDK guide.

These tools are not the focus of this document. Except for a number of Oracle legacy tools, equivalent functionality can be found in the Java JDK or in one or more mature open source products (from example, from the Apache Software Foundation).

DataDirect XQuery plays no role in this area.

Oracle XML DB

The Oracle XML DB features are integrated in the database engine and handle XML storage and its XML query and update capabilities. These features are described in detail in the “Oracle® XML DB Developer's Guide”.

To provide context for the product comparison, here is an overview of the relevant XML DB features.

Storing XML

Different options are available to store XML information in the Oracle database:

  • XMLType data type
    • Oracle’s XMLType data type is used to store XML information in a database table or column.
    • The XMLType can be associated with one or more columns in a table, or alternatively, a complete table can be defined as an XMLType table. In this case, the table has one pseudo column containing the XML data.
    • XML storage mode:
      • When an XML Schema is available (stored in the Oracle XML DB repository) and the schema is associated with the XMLType, Oracle uses a structured storage approach. In this case, inserted XML information is shredded in its composing parts and stored in traditional object-relational columns. The user has flexibility in how the shredding algorithm creates the underlying tables and columns.
      • When no XML Schema is associated with the XMLType, Oracle stores the XML as a CLOB (unstructured).
      • The Oracle documentation describes the advantages and disadvantages of each of these storage modes in detail. Here is a quick summary of the information. The structured approach is (1) somewhat slower when creating XML data, (2) less flexible in what XML it accepts (being XML Schema bound), and (3) opens up more powerful optimizations and data validations. The unstructured approach excels in flexibility but not in query or update performance.
  • XML DB Repository. Besides the traditional table/column mechanism of storing information in a RDBMS, Oracle XML DB offers a folder/resource (directory/file) based view. Once information, including XML files, is stored in the Oracle XML DB repository, it can be accessed using an URI scheme. When the stored information is XML, the URI can contain XPath 1.0 expressions that select part of the stored XML data.

Updating XML

Oracle supports updating XML data using a number of proprietary SQL functions:

  • updateXML replaces XML fragments.
  • insertChildXML inserts XML nodes as children of a given node.
  • insertXMLbefore adds XML nodes before a given node.
  • appendChildXML adds XML nodes as the last child nodes of a given node.
  • deleteXML deletes nodes.

Creating and Querying XML

The number of Oracle tools and features that allow querying and repurposing of relational and XML information is extensive. The many tools and features are the result of Oracle’s long history in a fast changing XML world, and its good habit of offering backward compatibility. The overlap between the different features is substantial and often confusing. Starting with Oracle 10g R2 the functionality offered by the SQL/XML and XQuery standards (both partially supported) should be sufficient to cover most needs. There might be scenarios where the legacy tools offer functional or performance benefits, but that situation is sure to disappear as Oracle’s implementation of the standards matures.

The SQL/XML publishing constructs (for example, XMLElement) create XMLType values from traditional relational data. The resulting values can be queried with Oracle XQuery. Furthermore, Oracle introduces a proprietary XQuery function, ora:view(), that creates a default SQL/XML view of relational data without going through the SQL/XML publishing features. This function can be used inside XQuery expressions to access data stored in tables or views.

Oracle supports XQuery features through the SQL/XML XMLQuery and XMLTable Select statement clauses. These constructs allow integration of XQuery in the Select statement syntax. It is an awkward but necessary approach to bridge the traditional SQL environment with the new XQuery features

New Features in DataDirect XQuery®

DataDirect XQuery® is now released!

DataDirect XQuery® provides full update support for relational data, easy integration for Web Services, additional enhancements for performance and scalability and more!

Download now!

Buy DataDirect XQuery®!

If you've watched our online video tutorials, read about DataDirect XQuery®'s extensive features, and tried our free download, you're ready to purchase DataDirect XQuery®.

Our buying page will answer any questions you have about ordering, purchasing, and obtaining support for your copy of DataDirect XQuery®.

New Case Study

Gevity produces sales proposals in real time using DataDirect XQuery®. See how Gevity uses DataDirect XQuery® to combine Web service data from SalesForce.com with relational data in Oracle in a pricing engine for HR management.