1 Reply Latest reply on Apr 26, 2012 7:28 AM by BluShadow

    XML DB - Insert / Update / Delete Items

    774420
      Hi

      I require some guidence on how to Insert / Delete / Update data from XML DB Schema.

      I have created XML table based on a sample PurchaseOrder.XSD and inserted couple of xmls into it.

      Now, I want to Added New Items / Delete Items & Update the Items data.

      I am able to update using the following query, I want to insert a new item, delete an existing item.


      UPDATE xml_PurchaseOrder t
      SET value(t) =
      updateXML(value(t),
      '/PurchaseOrder/LineItems/LineItem[2]',
      xmltype('<LineItem ItemNumber="4">
      <Description>Andrei Rublev</Description>
      <Part Id="715515009928" UnitPrice="39.95"
      Quantity="2"/>
      </LineItem>'
      )
      )
      WHERE existsNode(value(t),
      '/PurchaseOrder[Reference="999"]'
      ) = 1;