如何解决oracle xml-从多个相似节点获取节点值
这是xml,当类型='testAmount'和货币='INR'时,我想获取1234567
...整个xml太大,无法粘贴重要的
<testxml:testNotification>
<testxml:callAmount>
<testxml:money>
<testxml:type>testAmount</testxml:type>
<testxml:amount currency="USD">2127150</testxml:amount>
</testxml:money>
<testxml:money>
<testxml:type>testAmount</testxml:type>
<testxml:amount currency="INR">1234567</testxml:amount>----------------this one
</testxml:money>
<testxml:money>
<testxml:type>testDCAmount</testxml:type>
<testxml:amount currency="USD">2127150</testxml:amount>
</testxml:money>
<testxml:money>
<testxml:type>testDCAmount</testxml:type>
<testxml:amount currency="INR">1800099</testxml:amount>
</testxml:money>
</testxml:callAmount>
</testxml:testNotification>
...
我的尝试:
select x_identifier,mcb.*
FROM mcb
LEFT JOIN XMLTABLE(xmlnamespaces('http://testsystem.tst.test.net/testxmlpt-2-0' as "testxml"),'/testxml:testxmltestCollNot/testxml:Collateral/testxml:testMcall' PASSING mcb.OUTGOING_XML
COLUMNS x_identifier VARCHAR2( 300 ) PATH 'testxml:testNotification/testxml:callAmount/testxml:money/testxml:type/text()'
) X_mcb ON 1 = 1
;
我当前的输出: testAmounttestAmounttestDCAmounttestDCAmount
必需的输出: 1234567
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。