Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DB2V9.1 pureXML Creating Unique index with 2 attributes

0 views
Skip to first unread message

Rajesh Kumar Joshi

unread,
Apr 21, 2008, 2:14:17 AM4/21/08
to
I have a table with only 1 column as
Table : profileTable
//--------------
profile XML;
//--------------

A sample content of XML file is
<sampleprofile name="joe" version="A123">
<phone>123456789</phone>
..
..
</sampleprofile>
//------------------------------------

How can we create a UNIQUE index which includes both the 'name' and
'version' attributes?
I was able to create following indexes:
CREATE INDEX index1 ON profileTable(profile) GENERATE KEY USING
XMLPATTERN '/sampleprofile/@name' AS VARCHAR(16)
CREATE INDEX index2 ON profileTable(profile) GENERATE KEY USING
XMLPATTERN '/sampleprofile/@version' AS VARCHAR(16)

But although '/sampleprofile/@name | /sampleprofile/@version' is a
valid PATH expression I was unable to create an index like
CREATE UNIQUE INDEX index3 ON profileTable(profile) GENERATE KEY
USING XMLPATTERN 'sampleprofile/@name | /sampleprofile/@version' AS
VARCHAR(32)

Regards
Rajesh

0 new messages