xpath/xquery sql - Get all values

送分小仙女□ 提交于 2019-12-25 05:24:30

问题


Hi I have a blob of xml..

<string>1</string>
<string>2</string>
<string>3</string>
<string>4</string>
<string>11</string>
<string>1211</string>
<string>12331</string>

how would I get all the values using xpath/xquery in SQL

Thanks


回答1:


The xpath //string will return all the values in the intire xml the xpath /string will return only the values in the root node.

And for using it in sql look at this post XPath to fetch SQL XML value




回答2:


in oracle database

you have XMLType (see this) data type..

by this datatype you can get all the value..

all the examples are there itself, please go through that site.



来源:https://stackoverflow.com/questions/7567845/xpath-xquery-sql-get-all-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!