【发布时间】:2015-05-18 09:24:23
【问题描述】:
我正在尝试确定一个 xml 标记是否有两个特定的子标记。
XML Clob 的格式如下:
<ProductS>
<id>1</id>
<Discount></Discount>
<Promotion></Promotion>
</ProductS>
<ProductS>
<id>2</id>
<Discount></Discount>
</ProductS>
我希望我的 xmlquery 遍历这个 XML clob,并确定 ProductS 下是否有包含这两种折扣和促销类型的 xml 标记。
我的代码目前如下所示:
select existsNode(xmltype(rec1.xml), '/ProductS/Discount') into v_node_exists_discount from dual;
select existsNode(xmltype(rec1.xml), '/ProductS/Promotion') into v_node_exists_promotion from dual;
将上面的这两个语句与上述两个语句在这种情况下工作还是我需要做其他事情。
谢谢。
【问题讨论】: