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 > Dynamic xml query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-26-10, 14:09
db2_GoCubs db2_GoCubs is offline
Registered User
 
Join Date: Apr 2010
Posts: 3
Dynamic xml query

Hello, does anybody have any examples on where they are using parameter values to query for existence of a node based on a node name that is passed in. I have been able to get the below to work, however, the performance is subpar as you would imagine from having to cycle through the entire xml tree and running the condition across the node name.

IF XMLEXISTS('$c//(*, @*)[local-name()=$n]' PASSING @p_XmlFile AS "c",
@p_NodeName AS "n")

I have read somewhere that it might be possible to turn a string literal into a path expression but have not been able to replicate that for db2.

Thanks in advance
Reply With Quote
Reply

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