<!DOCTYPE PODesc SYSTEM "PODesc.dtd"><PODesc><doc_type>P</doc_type><order_no>62249675</order_no><order_type>N/B</order_type><order_type_desc>N/B</order_type_desc><supplier>10167</supplier><qc_ind>N</qc_ind><not_before_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></not_before_date><not_after_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></not_after_date><otb_eow_date><year>2016</year><month>09</month><day>25</day><hour>00</hour><minute>00</minute><second>00</second></otb_eow_date><earliest_ship_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></earliest_ship_date><latest_ship_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></latest_ship_date><terms>10003</terms><terms_code>45 days</terms_code><freight_terms>SHIP</freight_terms><cust_order>N</cust_order><status>A</status><exchange_rate>1</exchange_rate><bill_to_id>BT</bill_to_id><po_type>00</po_type><po_type_desc>No Store Cluster</po_type_desc><pre_mark_ind>N</pre_mark_ind><currency_code>CZK</currency_code><comment_desc>created by the Tesco Group Ordering System</comment_desc><PODtl><item>120000935</item><physical_location_type>W</physical_location_type><physical_location>207</physical_location><physical_qty_ordered>625</physical_qty_ordered><unit_cost>281.5</unit_cost><origin_country_id>CZ</origin_country_id><supp_pack_size>25</supp_pack_size><earliest_ship_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></earliest_ship_date><latest_ship_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></latest_ship_date><packing_method>FLAT</packing_method><round_lvl>C</round_lvl><POVirtualDtl><location_type>W</location_type><location>507</location><qty_ordered>625</qty_ordered></POVirtualDtl></PODtl><PODtl><item>218333522</item><physical_location_type>W</physical_location_type><physical_location>207</physical_location><physical_qty_ordered>180</physical_qty_ordered><unit_cost>230.94</unit_cost><origin_country_id>CZ</origin_country_id><supp_pack_size>18</supp_pack_size><earliest_ship_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></earliest_ship_date><latest_ship_date><year>2016</year><month>09</month><day>22</day><hour>00</hour><minute>00</minute><second>00</second></latest_ship_date><packing_method>FLAT</packing_method><round_lvl>C</round_lvl><POVirtualDtl><location_type>W</location_type><location>507</location><qty_ordered>180</qty_ordered></POVirtualDtl></PODtl><PODtl><item>218333416</item>
以上是存储在表列中的XML文件的一部分。我想提取标记<item>
和</item>
之间的所有字符串。 <item>
的单个文件中有多个值。我正在使用oracle 9i。任何人都可以提供适当的查询吗?
答案 0 :(得分:0)
弄清楚XML中XPath
的值是什么,然后使用ExtractValue
http://docs.oracle.com/cd/B10501_01/appdev.920/a96620/xdb04cre.htm#1024805
e.g。
select <your_rowid>, extractvalue( xmltype(<your_column>), <your_xpath>) from <your_table>
对于多个值,只需在同一个选择中执行多个提取值。