If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Text Search inside XML nodes with a specific Attribute

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-26-11, 10:01
nitaryann nitaryann is offline
Registered User
 
Join Date: Jul 2011
Posts: 3
Text Search inside XML nodes with a specific Attribute

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.
Reply With Quote
Reply

Tags
db2 text search, text search

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On