Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > DB2V9.1 pureXML...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 8806 of 9053
Post > Topic >>

DB2V9.1 pureXML Creating Unique index with 2 attributes

by Rajesh Kumar Joshi <rajeshjoshiji@[EMAIL PROTECTED] > Apr 20, 2008 at 11:14 PM

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/@[EMAIL PROTECTED]
' AS VARCHAR(16)
CREATE INDEX  index2 ON  profileTable(profile) GENERATE KEY USING
XMLPATTERN '/sampleprofile/@[EMAIL PROTECTED]
' AS VARCHAR(16)

But although    '/sampleprofile/@[EMAIL PROTECTED]
 | /sampleprofile/@[EMAIL PROTECTED]
' 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/@[EMAIL PROTECTED]
 | /sampleprofile/@[EMAIL PROTECTED]
' AS
VARCHAR(32)

Regards
Rajesh




 1 Posts in Topic:
DB2V9.1 pureXML Creating Unique index with 2 attributes
Rajesh Kumar Joshi <ra  2008-04-20 23:14:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 18:35:14 CDT 2008.