Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle XML INSERTCHILDXML

user8038490Oct 7 2014 — edited Oct 7 2014

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

This post has been answered by odie_63 on Oct 7 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 4 2014
Added on Oct 7 2014
4 comments
1,706 views