2016-08-30 55 views
0

我有以下XML文件閱讀嵌套的標籤XML文件中的蜂巢

<rec><name><fname>Ravi</fname><lname>kumar</lname></name> 
<age>25</age><contact> 
<email><personal>[email protected]</personal> 
<official>[email protected]</official></email> 
<phone><mobile>12345</mobile> 
<office>12346</office> 
<residence>12347</residence></phone></contact></rec> 

如何讀取嵌套的標籤!我是新來的蜂巢

+1

可以使用xpath_string/xpath_int使用xpath_string解析 –

+0

感謝@ankur()我可以讀出1級的數據,但如何讀取嵌套數據? – avijit

回答

0
select xpath_string(line,'rec/name/fname'),xpath_string(line,'rec/name/lname'),xpath_int(line,'rec/age'), 
........................................... 
xpath_string(line,'rec/contact/phone/residence') from <table_name>; 

希望這將有助於..