I need to select some values โโfrom the XML stored in the CLOB column in an Oracle database. The best I could come up with is the following:
select extract(xmltype(COLUMN), 'xpath-expression').getStringVal() as XMLVAL from TABLE t;
The problem is that when XPATH selects multiple nodes, the values โโare combined. I need each selected node on a separate line. Obviously, concatenation must happen in getStringVal (), I use this because I need to have strings in my client (and not in XMLType). What should I use instead of getStringVal ()?
EDIT: note that there is a similar question here: Oracle Pl / SQL: Loop through XMLTYPE nodes - but I could not apply it to my case. It uses two different XPATH expressions, and the principle of separation is not clear.
EDIT2: XML is very complex, but basically I need to find some value entries in
<string name="SOME_KEY" value="some value"/>
which clog under many other elements. I use XPATH //*[@name="SOME_KEY"]/@value and successfully find the value attribute of all XML elements that have the SOME_KEY attribute.
lbalazscs
source share