2016-09-22 3 views
-2

<!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. Может ли кто-нибудь запросить соответствующий запрос?Извлечь несколько подстрок из XML, хранящихся в таблице с типом данных CLOB (Oracle 9i)

ответ

0

Выяснить, что XPath значений находятся в вашем XML, а затем использовать EXTRACTVALUE

http://docs.oracle.com/cd/B10501_01/appdev.920/a96620/xdb04cre.htm#1024805

например

select <your_rowid>, extractvalue(xmltype(<your_column>), <your_xpath>) from <your_table> 

Для нескольких значений просто выполните несколько значений извлечения в одном и том же элементе.

Смежные вопросы