Extract data from XML Clob using SQL from Oracle Database

后端 未结 2 1958
北海茫月
北海茫月 2020-12-14 18:37

I want to extract the value of Decision using sql from table TRAPTABCLOB having column testclob with XML stored as clob.

Sample XML as below.

               


        
相关标签:
2条回答
  • 2020-12-14 19:11

    Try

    SELECT EXTRACTVALUE(xmltype(testclob), '/DCResponse/ContextData/Field[@key="Decision"]') 
    FROM traptabclob;
    

    Here is a sqlfiddle demo

    0 讨论(0)
  • 2020-12-14 19:32

    This should work

    SELECT EXTRACTVALUE(column_name, '/DCResponse/ContextData/Decision') FROM traptabclob;
    

    I have assumed the ** were just for highlighting?

    0 讨论(0)
提交回复
热议问题