检查存储在CLOB中的XML标记

时间:2012-11-28 18:16:50

标签: xml oracle oracle11g

我需要检查是否存在XML标记,其中XML存储为CLOB。

我试过了existsNode,但似乎遇到了麻烦。

只提供我感兴趣的XML(这是一个很大的):

<main requestType="create">
  <CATEGORY_ID>5</CATEGORY_ID>
  <NAME>Position Adhoc</NAME>
   <VIEW_CONFIG>
    <ViewConfig>
      <localization value="true"></localization>
      <DataSource dataFormat="XML" hasTotalRow="false" nodeDataFieldWidth="200" treeNodeDataField="0"></DataSource>
      <Ribbon>
        <Funds container="com.ssc.cfi.ribbon.fundbrowser.FundBrowser" enabled="true" entity="Portfolio" exclusiveGroup="" label="Portfolios" visible="true">
          **<List** enabled="true" fundFilterState="ACCT" label="Portfolio" maxSelectionAllowed="1000" showActiveCloseFunds="false" showManager="false"></List>
          <AllFunds enabled="true" entityName="AllFunds" showActiveCloseFunds="false"></AllFunds>

我需要查找XML标记“List”是否存在于XML中的任何位置。 XML数据作为clob存储在COL_A列中的TAB_A中。

试过这个,但是没有用,即使我们看到标签存在,它也会给我一个0的计数:

select count(1) 
from tab_a
where existsNode(extract(xmltype(col_a),'//main'),'//List') = 1

使用existsNode还是xmlexists的任何想法?

0 个答案:

没有答案
相关问题