Hi,

Have installed DB2 express-C 9.7 on Win7, and am using the DB2 Text Search engine.

I have one requirement to search inside all XML nodes having a specific attribute. Have tried these options:

statement.executeQuery("xquery " +
"for $i in db2-fn:sqlquery(\"SELECT doc FROM orders WHERE CONTAINS(doc, '@xpath:''/order//@key[. contains (\"\"java\"\")]''') = 1\")/order " + "return $i/customer");


statement.executeQuery("xquery " +
"for $i in db2-fn:sqlquery(\"SELECT doc FROM orders WHERE CONTAINS(doc, '@xpath:''/order//@key[.. contains (\"\"java\"\")]''') = 1\")/order " + "return $i/customer");

Here am trying to search for all those documents which have 'java' inside all child elements (of 'order' node) having an attribute 'key'.

May anyone please tell me what should be the right query for this.

Thanks.