Skip to Main Content

Database Software

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!

insert xml into column STORE AS BINARY XML ALLOW ANYSCHEMA fails

77111Jul 28 2009 — edited Jul 28 2009
I'm getting the error "ORA-44422: nonschema XML disallowed for this column" when trying to insert a schema based xml into a column marked with allow anyschema. I'm using Oracle 11.1.0.6.0.

1. create the table:

CREATE TABLE testxml (key VARCHAR2(30), flags NUMBER(10), data XMLType)
XMLTYPE COLUMN "DATA" STORE AS BINARY XML ALLOW ANYSCHEMA;


2. validate and try to insert the xml:

SET SERVEROUTPUT ON
declare
x XMLType;
xschema XMLType;
begin
x := XMLType(bfilename('XMLDIR', 'test.xml'), nls_charset_id('AL32UTF8'));
xschema := x.CreateSchemaBasedXml('http://auto3p.com/ascard/ascard.xsd');
xschema.SchemaValidate();
DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
insert into testxml (key,data) values ('123', xschema);
end;
*/*
Schema: http://auto3p.com/ascard/ascard.xsd Validated: 1
declare
***
ERROR at line 1:
ORA-44422: nonschema XML disallowed for this column
ORA-06512: at line 9

3. the test.xml root tag:

<card xmlns="http://auto3p.com/ascard" action="replace">...

4. The schema root tag:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://auto3p.com/ascard"
xmlns="http://auto3p.com/ascard"
elementFormDefault ="qualified">
<xs:element name="card" type="ASCardObj_30839_ComplexType" />....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2009
Added on Jul 28 2009
1 comment
2,196 views