Quote:
Originally Posted by ajagerCT
Do any of you know how to define an index using multiple Fields.
• Either 2 XML fields. (ie a pattern with two fields).
• Or Normal Col and a XML pattern (ie Mixed).
|
This seems to be impossible.
The SQL Reference Guide does not explicitly exclude the possibility of two columns combined with the "generate key using xmlpattern", but since the XML specification is "global", there seems to be no way to indicate to which of the two specified columns it belongs, neither seems there be a way to pass two such xmlpatterns.
I tried out a few syntax variants, but all gave error SQLCODE = -20304:
INVALID INDEX DEFINITION INVOLVING AN XMLPATTERN CLAUSE OR A COLUMN OF DATA TYPE XML. REASON CODE = 2
Did you pose the question on the IDUG DB2 list? (
LISTSERV 16.0 - DB2-L List at WWW.IDUG.ORG) Chances are that some DB2 insiders could tell you whether this has been "fixed" in version 10, or has been considered for vNext... (All I can say is that the v10 syntax for CREATE INDEX has not changed with respect to XMLPATTERN.)
I can only think of one option, in your case, to work around this restriction: concatenate the two xml fields "ref" & "account" (both in the index definition, and in your WHERE XMLEXISTS condition).