2 Replies Latest reply: Feb 20, 2013 3:42 AM by odie_63 RSS

    appendChildXml fails to update resource view

    312365
      Hi All,

      I am having difficulty using the new 10gR2 function 'appendChildXml' in the resource_view. Here's the situation:

      # check the existing contents
      TEST@apax> select extract(res, '/Resource/Contents/*') CONTENTS
      from resource_view
      where any_path='/home/test/test-doc.xml';

      CONTENTS
      ----------------------------------------------------------------------------------------------------
      <test><element/></test>

      # update the resource
      TEST@apax> update resource_view
      set res = appendchildxml(
      res,
      '/r:Resource/r:Contents/test',
      xmltype('<another_element/>'),
      'xmlns:r="http://xmlns.oracle.com/xdb/xdbresource.xsd"')
      where any_path='/home/test/test-doc.xml';

      1 row updated.

      TEST@apax> commit;

      Commit complete.

      # check the contents again
      TEST@apax> select extract(res, '/Resource/Contents/*') CONTENTS
      from resource_view
      where any_path='/home/test/test-doc.xml'; 2 3

      CONTENTS
      ----------------------------------------------------------------------------------------------------
      <test><element/></test>

      The resource is not schema-based and the 'TEST' user has all appropriate rights and ACL privileges to update the resource.

      Any ideas?