This content has been marked as final. Show 6 replies
Oh no it didn't.....
Under no circumstances should contains / haspath / be used with XML Containing namespaces. The haspath and inpath operators do a blind text match on the namespace prefix, they do not resolve the prefix to the namespace and match nodes in the namespace identified by the prefix. You will get wrong results.
Use the syntax I recommended. If you are not working with an XML Schema you should download 11g and use the new 11g XML Index to optimize these queries, and use XMLExists rather than existsNode
Thanks for the response... I did get rid of that error I was getting by creating an index...Unfortunately we dont use 11g as of now... now sure if we will be moving to that any time in near future.
In addition to creating the index I did modify my quey as well to make it work. Anyhow - that didnt resolve my problem.
I have something stored as follows:
The number of <name> can increase dynamically. I was wondering if there is a way that I can handle these multiple (unknown) name tags (example get different rows for each tag)? Not even sure if that is possible.
Also, with the inpath, I was looking for name1. However, the way I was doing was I was getting the result as
name1name2 and INPATH was looking for name1 in this whole string. As a result the output was not what I wanted - rather the way I was extracting was not what I want.
Anyone knows how to handle dynamic tags or writing the query and knowing the number of tags that may appear is required?
Any help appreciated.
haspath and inpath are not considered part of XML DB since they do not support XPath properly. If you want to use haspath and inpath you need to pose the questions in the Oracle Text forum. If you are comparing haspath and inpath with db2 version 9, based on your other posts your are comparing 1990's solution with a 2006/2007 solution which is clearly pointless.
Message was edited by: