Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> OTą insert xmltype

OTą insert xmltype

From: Jeroen van Sluisdam <jeroen.van.sluisdam_at_vrijuit.nl>
Date: Fri, 30 Jul 2004 15:18:53 +0200
Message-ID: <727A513477946E4380C23DD63C36FCC0F044DA@pedro.vrijuit.nl>


Í have defined very simple schema
declare
doc varchar2(1000) := '
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="message">
<xs:complexType>
<xs:sequence>
<xs:element name= "veld1" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

';
begin
dbms_xmlschema.registerschema('http://www.oracle.com/simpletest2.xsd', doc );
end;
This works fine

SQL> l
1 create table simplexml(
2 id number,
3 msg sys.XMLType )
4* xmltype column msg XMLSCHEMA "http://www.oracle.com/simpletest2.xsd" element "message"

This also works

Problem comes here
insert into simplexml (id, msg) values (1, xmltype('<?xml version="1.0" ?> *
ERROR at line 1:
ORA-19007: Schema and element do not match

SQL> l
1 insert into simplexml (id, msg) values (1, xmltype('<?xml version="1.0" ?> 2 <xs:message
3 xmlns:xs="http://www.oracle.com/simpletest2.xsd" 4 xmlns:xsi="http://www.w3.org/2001/XMLSchema" 5 xsi:schemaLocation="http://www.oracle.com/simpletest2.xsd"> 6 <veld1>"test"</veld1>
7 </xs:message>
8* '))
SQL> What is wrong, please help this gives me a headache

Tnx,

Jeroen    

P.S. Any other forums besides otn known about xml and oracle !  



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Jul 30 2004 - 08:14:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US