Read an XMLtype with pl / sql

0

I have a function that receives an xml parameter, I need to keep only one part, and return that "new xml". I understand it is done with the Extract function but it would not be working for me. I get error: ORA-00932 incosistent datatypes: expected CHAR got - Obviously I look for them and change the types of the parameters, etc, but there is no case, I do not get it. What I need as output is just the xml portion within the event nodes, not the data if not all the xml itself. Example:

Thanks !!!

    
asked by Jesica 18.09.2018 в 14:06
source

1 answer

0

The way I worked with the XML is by extracting it from the DB and then processing the XML node to node. In the case you mention, to keep everything inside the event node would be something like this:

SELECT EXTRACT (VL_XL_XML, '/params/evento', VL_C_ESPACIO) INTO VL_XL_EVENTO FROM DUAL;

Where VL_XL_XML is a variable of type XMLTYPE that contains the complete XML, VL_C_ESPACIO is a VARCHAR2 that contains the namespace of the XML and VL_XL_EVENTO is a variable of type XMLTYPE in which the node that we have extracted is stored.

Let's see if this is good for you.

    
answered by 19.09.2018 в 08:57