我们将xml存储在oracle数据库中 . 列类型是CLOB . 我可以使用以下查询从xml标记中获取数据 . 当我执行查询时,我得到null .
XML in the column:
<input xmlns="http://google.com/testsystem"
xmlns:testsystem="http://test.com/testSystem"
xmlns:tns="http://google.com/testService/">
<ProcessData>
<reviewYear>2014-2015</reviewYear>
</ProcessData>
</input>
表名:test_table列名:input_xml列类型:CLOB
Query:
select extract(xmltype(input_xml),'//reviewYear/text()').getStringVal() as data
from test_table
where id = 1;
Result:
DATA
------------------------------------
1 回答
你需要指定命名空间,请尝试下一个查询
UPD .
更新尝试