Date Posted: February 13, 2007
Update: March 3, 2008 Version 1.1 supports IBM DB2 Version 9.5's support for transform expression defined in XQuery Update Facility 1.0; also allows indenting of XML result and saving of query result to a file.
Tab navigation
- 1. What is XQuery?
- 2. Can I use another version of DB2® 9?
- 3. Could XQuery Whiteboard perform better?
- 4. What should I do if I'm having trouble running XQuery Whiteboard?
- 5. If I only want to operate on local documents or remote documents, do I still need to connect to DB2 9?
- 6. How can I see attribute results?
- 7. What is the XQuery Update Facility?
1. What is XQuery?
XQuery is a functional query language that operates on XML documents and fragments. It is analogous to SQL, which is a non-procedural query language that operates on tables.
XQuery 1.0 became a W3C Recommendation on January 23, 2007. It was developed by the XML Query Working Group. Several books about XQuery 1.0 have been published.2. Can I use another version of DB2® 9?
No. XQuery Whiteboard uses the XMLTABLE XML function that was added to SQL in IBM® DB2, Version 9.1, for Linux®, UNIX®, and Windows®. This XML function had not yet been implemented in other versions of DB2 9.
3. Could XQuery Whiteboard perform better?
Yes. In particular, the use of the table: URI in the fn:doc function causes the creation of an XML document that represents the entire table. In many cases, only a small number of the elements representing the tables columns and rows are actually used. A better approach would be to construct only those columns that are needed and to push some of the XQuery predicates on the constructed document into an inner SQL query.
4. What should I do if I'm having trouble running XQuery Whiteboard?
You might want to increase some of the database configuration parameters. I've been using the following values:
- APPLHEAPSZ: 4096
- DBHEAP: 2400
- STMTHEAP: 8192
- LOGFILSIZ: 4000
5. If I only want to operate on local documents or remote documents, do I still need to connect to DB2 9?
Yes. XQuery Whiteboard parses and analyzes the XQuery expression that is entered and then generates a SQL statement for DB2 to execute.
6. How can I see attribute results?
You can use the fn:data function in order to see the content of the attributes. Examples are shown in the following XQuery expressions:
doc('column:ANDREW.PURCHASEORDER.PORDER')/*/data(@PoNum)
|
for $a in doc('column:ANDREW.PURCHASEORDER.PORDER')/*/@PoNum
return data($a)
|
7. What is the XQuery Update Facility?
The XQuery Update Facility is an extension of XQuery 1.0. It adds four updating expressions: delete, insert, rename, and replace. It adds one non-updating expression: the transform expression. XQuery Whiteboard 1.1 and DB2 9.5 both support the transform expression. The updating expressions can be used in the modify clause of the transform expression.
XQuery Update Facility 1.0 became a W3C "Last Call Working Draft" on August 28, 2007. It was developed by the XML Query Working Group (WG).