从网上找了很多版本,没有找到自己想要的,然后简单总结了下,看的比较明了一些
xml:
<root>
<abc>张</abc>
<def>王</def>
<jhk id="83" type="01" start="09" end="10" reason="11" />
</root>
oracle:
xml := '';
id_value := '';type_value := '';start_value := '';end_value := '';
abc_value := '';def_value := '';
select xml_value into xml_ from table where xml_value = 'xml';
--获取节点属性的信息
BEGIN
SELECT extract(VALUE(t), '//@id').getStringVal(),
extract(VALUE(t), '//@type').getStringVal(),
extract(VALUE(t), '//@start').getStringVal(),
extract(VALUE(t), '//@end').ge