Friday, April 07, 2006

DB2 Viper

DB2 Viper is the code name for the next release of DB2. DB2 Viper can handle both relational and XML data. In what it terms as "native XML", the XML data is stored in a parsed heirarchical format rather than requiring it to be transformed into row and column format or store it as a large object. The new storage structure will enable you to query the database using XQuery or SQL. You can download the beta version on the DB2 Viper download site. The administrators can use standard SQL data definition language statements to create database objects to store relational and XML data, and this can be done in a single statement. For example, to create a table with an XML column, you can make the query as follows:

create table case (
caseNumber varchar(10)
primary key not null,
status varchar(10),
schedule varchar(30),
county varchar(10),
arraignmentNotice xml
Since the XML data is self-describing, you don't have to give additional information with it. It will be accepted as long as it is well-formed. You can also create an XML index to speedup your searches of the XML data. This requires the index key to defined using an "xmlpattern", which is an XPath expresssion (no predicates, ofcourse) to identify the subset of the XML document. You will also have to specify the SQL datatype represented by the subset selected by the XPath expression. For example:

create index caseIndex on case(arraignmentNotice)
generate key using xmlpattern '/arraignmentNotice/date'
as sql DATE
The following is a list of the features provided with DB2 Viper
  • Efficient storage techniques for managing XML data in hierarchical format.
  • Support for indexing XML data
  • Support for XQuery as well as SQL (with XML extensions) to query XML data
  • Support for validating XML data using schemas
  • API support for popular languages like Java, C, COBOL and .NET platform
  • An Eclipse based developer's workbench which includes a graphical XQuery builder.
Additional references:

1 comment: