My Oracle Support Banner

Insertion Of A New Record In A Schema-Based XML Table Fails With ORA-31000 For Non-Schema Owner (Doc ID 761636.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Server - Enterprise Edition - Version: and later   [Release: 11.1 and later ]
Information in this document applies to any platform.


  • As UserA registered an XML Schema and an XMLTYPE table created based upon this XML Schema.

    '<xs:schema xmlns:xs="" 
      <xs:element name="Employee" xdb:SQLType="EMP_TYPE"> 
            <xs:element name="EmployeeId" type="xs:positiveInteger"/> 
            <xs:element name="PhoneNumber" maxOccurs="10"> 
              <xs:attribute name="No" type="xs:integer"/> 
        local     => TRUE, 
        genTypes  => TRUE, 
        genBean   => FALSE, 
        genTables => FALSE 


    CREATE table emp_tab OF XMLType 
    XMLSCHEMA "emp.xsd" ELEMENT "Employee" 
    VARRAY xmldata."PhoneNumber" STORE AS table phone_tab; 

  • Privileges granted to UserB.

    GRANT all ON emp_tab TO UserB;

  • UserB fails to insert an XML document into the Schema-Based table.
    INSERT INTO UserA.emp_tab
    <PhoneNumber No="1234"/>
    <PhoneNumber No="2345"/>
    ERROR at line 6:
    ORA-31000: Resource 'emp.xsd' is not an XDB schema document
    ORA-06512: at "SYS.XMLTYPE", line 232
    ORA-06512: at line 1



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.