【发布时间】:2017-10-02 01:55:30
【问题描述】:
我希望得到您的帮助,因为我想从 XML 文件中的每条记录中提取 XML 字符串,然后我需要将选定的记录插入到 clob 字段中。非常感谢您的帮助。
注意:我在 Dep.xml 中有 xml 结构
<?xml version="1.0" encoding="UTF-8"?> <dataroot xmlns:od="urn:schemas-
microsoft-com:officedata" generated="2017-09-20T17:59:05">
<Dep><ID>157</ID> <ORDER>7</ORDER> <SIGS>PPQ (PRAS)</SIGS> </Dep>
<Dep><ID>157</ID> <ORDER>7</ORDER> <SIGS>PPQ (PRAS)</SIGS> </Dep>
我想从查询中得到这个:
No. Reg.| XML
1 | <?xml version="1.0" encoding="UTF-8"?> <Dep><ID>157</ID><ORDER>7</ORDER><SIGS>PPQ (PRAS)</SIGS></Dep>
2 | <?xml version="1.0" encoding="UTF-8"?> <Dep><ID>7</ID><ORDER>19</ORDER><SIGS>PPT</SIGS></Dep>
之后;将注册表插入到 clob 字段中
No. Reg.|CLOB FIELD
1 |<?xml version="1.0" encoding="UTF-8"?> <Dep><ID>157</ID><ORDER>7</ORDER><SIGS>PPQ (PRAS)</SIGS></Dep>
2 |<?xml version="1.0" encoding="UTF-8"?> <Dep><ID>7</ID><ORDER>19</ORDER><SIGS>PPT</SIGS></Dep>
【问题讨论】:
-
文件
dep.xml在哪里?你想如何加载文件?这是一次性的练习还是您需要构建可重用的功能?为什么dep.xml不是格式良好的 XML 文档?为什么要将其存储在CLOB列中而不是XMLType中?
标签: xml database oracle insert clob