且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Oracle 中选择 xml 元素值

更新时间:2022-05-31 22:53:42

由于a元素没有命名空间,所以可以在函数中不使用命名空间,先提取其子元素,然后使用命名空间从 b 中提取值:
试试:

Since the a element does not have the namespace, you can first extract its child elements without using namespaces in the function, and then extract the value from the b with the namespace:
Try:

select extract(extract(myColumn, 'a/*'),
               'b/c/text()',
               'xmlns=urn:www.someSite.com/myModel') 
  from myTable