1 Reply Latest reply: Sep 24, 2013 6:15 AM by odie_63 RSS

    Register schema error for invalid attribute SQLName


      Hi ,


      I am trying to Register an XSD for Object Relational Storage in my DB I get the below mentioned error when I try to register the schema. I think I am going wrong somewhere in schema annotations because without them it was registering fine.

      I just want the underlying tables created from "element names" to have name annotations as mentioned in "xdb:SQLName" type.

      Any assistance would be appreciated - thanks.


      SCHEMADOC=>'<?xml version="1.0" encoding="UTF-8"?>
                    <xs:element name="purchaseOrder" xdb:SQLName="PURCHASE_ORDER">
                          <xs:element ref="Ordername"/>
                          <xs:element ref="Orderid"/>
                    <xs:element name="OrderType" xdb:SQLName="ORDER_TYPE">
                              <xs:element minOccurs="1" maxOccurs="1" ref="Orderdetails"/>
                    <xs:element name="Orderinstance" type="xs:string" xdb:SQLName="ORDER_INSTANCE"/>
                    <xs:element name="Orderexpiry" xdb:SQLName="ORDER_EXPIRY">
                            <xs:element minOccurs="0" maxOccurs="unbounded" ref="Expiryinfo"/>
                    <xs:element name="Ordervalue" type="xs:string" xdb:SQLName="ORDER_VALUE"/>
                    <xs:element name="Ordercode" type="xs:string" xdb:SQLName="ORDER_CODE"/>
         LOCAL     => TRUE,
         GENTYPES  => TRUE,
         GENTABLES => TRUE);




      Error report -

      ORA-31082: invalid attribute "SQLName" specified in declaration of "purchaseOrder"

      ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 3

      ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 14

      ORA-06512: at line 2

      31082. 00000 -  "invalid attribute \"%s\" specified in declaration of \"%s\""

      *Cause:    The XML schema specifies an invalid attribute.

      *Action:   Remove specification of the invalid attribute.


      Message was edited by: 991278

        • 1. Re: Register schema error for invalid attribute SQLName

          First question : do you really want to create tables for every top-level elements declared in the schema ?

          Personally, I wouldn't.

          I'd just create one for the root element (purchaseOrder), whose name we can control via the xdb:defaultTable annotation.

          Use xdb:defaultTable="" to prevent Oracle from generating them.


          Secondly, xdb:SQLName controls the naming of the generated object attributes, so doesn't apply to a root element.

          XML Schema Storage and Query: Basic


          Besides, the schema you gave is invalid (not only because of the annotations), so I guess it's not the real one, is it?