By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

DB2V9.1 pureXML Creating Unique index with 2 attributes

P: n/a
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

Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.