Hi,
i want to add an XML Child Node to a XML-Column in dependency, when the upper element has a special attribute value. The XML-Document looks like this:
<root_element>
<node>
<subnode name="a"/>
<subnode name="b"/>
<subnode name="c"/>
</node>
</root_elemnt>
so i want to insert a child node for the subnode with the name c, so that it looks after completing like:
<root_element>
<node>
<subnode name="a"/>
<subnode name="b"/>
<subnode name="c">
<new_element/>
</subnode>
</node>
</root_elemnt>
I tried the following SQL-Statement, but it didn't work:
update table_a a SET a.DOCUMENT =
INSERTCHILDXML(a.DOCUMENT, '/root_element/node/subnode/@name=c, 'new_element', XMLTYPE('<new_element>blabla</new_element>'))
where ...;
The Statement is executeable, i don't get any XPATH-Expression-Errors....
I hope that you can help me.
Heiko