SELECT * from XMLTABLE (' $B/deal_basic/user_deal_info ' passing
XMLTYPE (' <?xml version= ' 1.0 ' encoding= ' gb2312 '? >&xml ') as B
COLUMNS user_deal_id VARCHAR2 () PATH
'/user_deal_info/user_deal_id ',
Deal_inure_time VARCHAR2 () PATH
'/user_deal_info/deal_inure_time ',
Deal_expire_time VARCHAR2 () PATH
'/user_deal_info/deal_expire_time ',
Deal_create_time VARCHAR2 () PATH
'/user_deal_info/deal_create_time ');
<DEAL_BASIC>
<USER_DEAL_INFO>
<USER_DEAL_ID>1000100001</USER_DEAL_ID>
<DEAL_INURE_TIME>20081130</DEAL_INURE_TIME>
<DEAL_EXPIRE_TIME>30000101</DEAL_EXPIRE_TIME>
<DEAL_CREATE_TIME>20081130</DEAL_CREATE_TIME>
</USER_DEAL_INFO>
</DEAL_BASIC>
--------------------------------------------------------
--The case one completed
SELECT * from XMLTABLE (' $B/row ' passing
XMLTYPE (' <?xml version= ' 1.0 ' encoding= ' gb2312 '? >&xml ') as B
COLUMNS
tp_id VARCHAR2 () PATH
'/row/tp_id ',
Tp_name VARCHAR2 () PATH
'/row/tp_name ',
Tp_parentid VARCHAR2 () PATH
'/row/tp_parentid ',
Tp_sname VARCHAR2 () PATH
'/row/tp_sname ');
<ROW>
<TP_ID>112</TP_ID>
<TP_NAME>oracle</TP_NAME>
<TP_PARENTID>0</TP_PARENTID>
<TP_SNAME>R</TP_SNAME>
</ROW>
----------------------------------------------------------------------
--Case Two single quotation marks are not recognized
SELECT * from XMLTABLE (' $B/deal_basic/user_deal_info ' passing
XMLTYPE (' <?xml version= ' 1.0 ' encoding= ' gb2312 '? >&xml ') as B
COLUMNS user_deal_id VARCHAR2 () PATH
'/user_deal_info/row_id ',
Deal_inure_time VARCHAR2 () PATH
'/user_deal_info/row_time ',
Deal_expire_time VARCHAR2 () PATH
'/user_deal_info/row_name ');
<DEAL_BASIC>
<USER_DEAL_INFO>
<ROW_ID>1000100001</ROW_ID>
<ROW_TIME>ORACLE</ROW_TIME>
<ROW_NAME>30000101</ROW_NAME>
</USER_DEAL_INFO>
<USER_DEAL_INFO>
<ROW_ID>1000100001</ROW_ID>
<ROW_TIME>ORACLE</ROW_TIME>
<ROW_NAME>30000101</ROW_NAME>
</USER_DEAL_INFO>
</DEAL_BASIC>
--------------------------------------------------------------------
--The case of the third completed
SELECT * from XMLTABLE (' $B/orderlist/order ' passing
XMLTYPE (' <?xml version= ' 1.0 ' encoding= ' gb2312 '? >&xml ') as B
COLUMNS OrderID VARCHAR2 () PATH
'/order/orderid ',
OrderNumber VARCHAR2 () PATH
'/order/ordernumber ',
Orderpricee VARCHAR2 () PATH
'/order/orderprice ');
<orderlist>
<order>
<orderid>1</orderid>
<ordernumber>857544544</ordernumber>
<orderprice>54</orderprice>
</order>
<order>
<orderid>2</orderid>
<ordernumber>858544544</ordernumber>
<orderprice>63</orderprice>
</order>
<order>
<orderid>3</orderid>
<ordernumber>454854555</ordernumber>
<orderprice>781</orderprice>
</order>
</orderlist>
It took a long, long, and finally a little connection.
Oracle Parsing XML complete version