本文介绍了XML Oracle:多子节点提取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我有一个 xml 代码:
I have an xml code :
我的代码:
我的问题:如何循环子节点使数据变成这样:
My problem : How to loop child nodes so the data will become like this :
任何帮助将不胜感激.
推荐答案
你可以使用 XMLTable()
函数来达到预期的效果:
You can achieve desired result by using XMLTable()
function:
结果:SQLFiddle 演示
了解更多关于XMLTable()
函数.
注意:使用 11.2.0.2 之前的 Oracle 版本,当 cursor_sharing
参数设置为 FORCE
或 SIMILAR
(从 11.2 开始弃用).将cursor_sharing
参数设置为EXACT
(默认值),即可解决问题.
Note: Working with Oracle releases prior to 11.2.0.2, you can encounter ORA-1780 error
(bug 8545377) on certain types of XML queries when cursor_sharing
parameter is set to FORCE
or SIMILAR
(deprecated starting from 11.2). Setting cursor_sharing
parameter to EXACT
(default value), will solve the problem.
这篇关于XML Oracle:多子节点提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!