Conclusion: Querying XML Columns with DataDirect XQuery®™

DataDirect XQuery® can query XML stored as character data, but you must provide a Java external function to parse the XML.

Because DataDirect XQuery® uses SQL to query relational databases, this means that DataDirect XQuery® cannot directly evaluate XQuery expressions against XML stored in a column of a relational database. As an alternative, DataDirect XQuery® provides three ways to query XML that is stored in a column of a database as XML:

  • Return the entire XML column.

  • Use the evaluate-in-memory extension expression to write portable queries that evaluate the XML in memory.

  • Use vendor-specific SQL functions to query the XML more efficiently, at the cost of portability. We have shown the most common ways to do this with DB2 and Oracle.

Future versions of DataDirect XQuery® will provide this functionality in a transparent, portable, and efficient way.