Oracle Pl/SQL: Loop through XMLTYPE nodes

前端 未结 5 1060
长情又很酷
长情又很酷 2020-12-04 14:38

I have a XMLTYPE with the following content:


    
        
            user1
         


        
5条回答
  •  孤城傲影
    2020-12-04 15:08

    You can use XQuery. Check out the select statement below. v_xml_doc is the XMLTYPE variable containing the XML data.

    select name
    from   XMLTable('for $i in /users/user
                                return $i'
                                passing   v_xml_doc
                                columns   name varchar2(200) path 'name'
                   )
    

提交回复
热议问题