Get off to a fast start with DB2 pureXML

April 29, 2010

If you -or your colleagues- are new to managing and querying XML data in DB2, then this 5-part article series “Get off to a fast start with DB2 9 pureXML” might be a good starting point. These articles were originally written for DB2 9.1, but recently all five parts have been updated for DB2 9.5 and 9.7. Here they are:

Part 1: XML to the core (Introduction)

Part 2: Create and populate a DB2 XML database

Part 3: Query DB2 XML data with SQL

Part 4: Query DB2 XML data with XQuery

Part 5: Develop Java applications for DB2 XML data

If you want to get a little bit deeper from here, I can recommend a few additional resources:

For example, if your interest is in querying XML data, take a look at “pureXML in DB2 9: Which way to query your XML data?” or “XMLTABLE by Example“.

For a deep dive on XML updates and transformations, see “Updating XML in DB2 9.5“.

In case you’re a Java developer and interested in the new XML features in JBDC 4.0, read my previous blog post on “XML Support in JDBC 4.0: The SQLXML Interface“.

XML performance topics are covered in “15 Best Practices for pureXML Performance in DB2 9” and “Exploit XML Indexes for XML Query Performance in DB2 9“. These two articles provide tuning and configuration guidelines for XML performance in DB2. But, if you’re more interested in performance results and measurements, see “A Performance Comparison of DB2 9 pureXML with CLOB and Shredded XML Storage or the results of the TPoX benchmark.

If these articles don’t provide what you’re looking for, browse through the DB2 pureXML Wiki or the DB2 pureXML Cookbook. – or post a comment to this blog with any requests or questions you might have!

Happy Reading…


2 Responses to “Get off to a fast start with DB2 pureXML”

  1. jacek francuz Says:


    I’d like to ask about contains() function in DB2, that is connected to pureXML technology. What is very strange is DB’s behaviour while using wildcards. I think it’s obvious, that if someone uses wildcard then result that is returned should return at least as many items as result of expression that contains no wildcards at all. What’s strange is that expression containing only wildcard in it, i.e. “%” returns nothing. Also expression that has wildcard keyword at the end of statement eg. “sth%” returns nothing while “sth” matches some records.

    It’s prerty strange for me. What is most intuitive is that using wildcards(‘_’,’%’) you should take at least as many records as using no wildcards at all,
    because their number can be 0 or more- so it’s not bounded in any way.

    Please take it under consideration.

    Much appreciated,

    Jacek Francuz

    • Hi Jacek, are you referring to the SQL function CONTAINS, or to the XQuery function fn:contains? Note that the XQuery function fn:contains is not a function for wildcard search.

      If you are looking for a text-search function that you can use with wildcards within XPath or XQuery, use db2-fn:xmlcolumn-contains instead of fn:contains. The function db2-fn:xmlcolumn-contains can be used with the new Lucene-based DB2 Text Search, and allows “?” and “*” as wildcards.

      Maybe you can post or send me the exact queries that you used. Then I might be able to tell why they didn’t behave as you expected.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: