XML schema size restrictions
I was wondering what size restrictions there are on XML schemas? I'm developing a schema that has just raised the following error on registration.
ERROR at line 1:
ORA-31084: error while creating table "CAS"."swift564357_TAB" for element "swift564"
ORA-01792: maximum number of columns in a table or view is 1000
ORA-02310: exceeded maximum number of allowable columns in table
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 151
ORA-06512: at line 828
On removing a few elements from the schema it registers fine, but querying the generated table swift564xxx_TAB there is only ever one column, typed with an ADT that itself only has 5 elements. In fact there doesn't seem to be, on the face of it, any type that has more than 20-30 elements. Where does this error come from then?
Unfortunately the schema exceeds the 20k limit on postings. I can split it up and post it in two parts if this would help.
Thanks
Marc
Each attribute in the ADT and each attribute of attributes which are an ADT count as one column
Here's a snippet from the next version of the doc that may help...
3-20 Oracle XML DB Developer’s Guide, Rel. 1(10.1) Beta 2 Draft
A number of issues can arise when working with large, complex XML Schemas.
Sometimes the error "ORA-01792: maximum number of columns in a table or view
is 1000" will be ecountered when registering an XML Schema or creating a table
based on a global element defined by an XML Schema. This error occurs when an
attempt is made to create an XMLType table or column based on a global element
and the global element is defined as a complexType that contains a very large
number of element and attribute definitions.
The errors only occurs when creating an XMLType table or column that uses object
relational storage. When object relational storage is selected the XMLType is
persisted as a SQL Type. When a table or column is based on a SQL Type, each
Registering an XML Schema with Oracle XML DB
attribute defined by the Type counts as a column in the underlying table. If the SQL
Type contains attributes that are based on other SQL Types, the attributes defined
by those Types also count as columns in the underlying table. If the total number of
attributes in all the SQL types exceeds the Oracle limits of 1000 columns in a table
the storage table cannot be created.
This means that as the total number of elements and attributes defined by a
complexType approaches 1000, it is no longer possible to create a single Table that
can manage the SQL Objects generated when an instance of the Type is stored in the
database.
In order to resolve this problem it is necessary to reduce the total number of
attributes in the SQL Types that are used create the storage tables. Looking at the
schema there are two approaches that can be used to achieve this:
The first approach uses a ’top-down’ technique that uses multiple XMLType
tables to manage the XML documents. This technique reduces the number of
SQL attributes in the SQL Type heirarchy for a given storage table. As long as
none of the tables need manage more than 1000 attributes the problem is
resolved.
The second approach uses a ’bottom-up’ technique that reduces the number of
SQL attributes in the SQL Type herirarchy collapsing some of elements and
attributes defined by the XMLSchema so that they are stored as a single CLOB.
Both techniques rely on annotating the XML Schema to define how a particular
complexType will stored in the database.
In the case of the top down techniqueby the annotations SQLInline="false" and
defaultTable are used to force some sub-elements within the XML Document to
be stored as rows in a seperate XMLType table. Oracle XML DB maitains the
relationship between the two tables using a REF of XMLType Good candidates
for this approach are XML Schemas that define a choice where each element
within the choice is defined as a complexType, or where the XML Schema
defines an element based on a complexType that contains a very large number
of element and attribute definitions.
The bottom up technique involves reducing the total number of attributes in the
SQL object types by choosing to store some of the lower level complexTypes as
CLOBs, rather than objects. This is acieved by annotating the complexType or
the usage of the complexType with SQLType="CLOB".
Which technique is best depends on the application, and the kind of queries and
updates that need to be performed against the data.
Similar Messages
-
Hi,
I am usnig the file adapter to read the XML file, is there any restriction on the file size. Is this documented anywhere in oracle document.
Please advice.
Regards,
SreejitHi Sreejit,
Apart from what is documented in the 10.1.3.3 SOA Best Practices Guide, if you have a huge XML file with repeating nodes, you can process them in manageable chunks.
With attachment feature, you can copy/move large files opaquely from one folder to another.
Hope this helps!
Cheers
Anirudh Pucha -
XML Schema -- xsi:null in document instance and nullable in XSD
Hi,
I have an XML document
<DOC>
<EMP_ID>1</EMP_ID>
<EMP_NAME>Scott</EMP_NAME>
<EMP_ADDRESS>USA</EMP_ADDRESS>
</DOC>
As to what I understand, for the document to look like
<DOC>
<EMP_ID>1</EMP_ID>
<EMP_NAME>Scott</EMP_NAME>
<EMP_ADDRESS></EMP_ADDRESS>
</DOC>
with no value in <EMP_ADDRESS> tag, I have to use nullable attribute in XSD and xsi:null attribute in document. Is there any other way where we don't make any modificaitons in the documentHi, Thanks for the reply.I have a scenario like this :
1. We have lot of xml files in our application server ( size ranges form 2 MB to 200 MB).
2. We have xml schema based structured storage for a column "personjoininfo" for a relational table --- Table is :
CREATE TABLE PERSON_COMP_TABLE
empId VARCHAR2(100) CONSTRAINT pk_PERSONCOMP PRIMARY KEY
,comments VARCHAR2(20)
,joindate DATE
,personjoininfo xmltype
XMLTYPE COLUMN personjoininfo XMLSCHEMA "www.PersonInfoUrl.com" element "person"
3. What is the best option for me to load the xml files in the personjoin info column along with the other column values.
As I know , if I use the XML DIR ( directory feature ), I would need to put these xml files in the database server for loading ---
So, what are my options in this scenario for loading these xml files ?
Thanks -
XMLType column based on XML Schema: several questions
Hi,
I've a table on an oracle db version 10.1.0.4 where I stage the xml files containing orders created on a third party's system using BizTalk.
Although the storage I opted for is based on an XML Schema, defined by this third-party, I am facing big perfomance issues with files bigger than a few hundreds of kBs.
For instance, a 32Mb file takes more than 2 hours to be processed.
Now, after reading other threads in this forum and the documentation, my understanding of the problem is that the whole issue is with the correct indexing of the nested tables.
Here is my current XML Schema definition:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xdb:storeVarrayAsTable="true">
<xs:include schemaLocation="private/Types.xsd"/>
<xs:element name="PickData">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="ProdRun">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="xs:int"/>
<xs:element name="Date" type="string8"/>
<xs:element name="Final" type="xs:int"/>
<xs:element name="PickWave" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="string10"/>
<xs:element name="ProdLine" type="string2"/>
<xs:element name="TourSeq" type="xs:int"/>
<xs:element name="Tour" type="string20"/>
<xs:element name="Customer" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Seq" type="string20"/>
<xs:element name="Cust" type="string10"/>
<xs:element name="Mod" type="string30"/>
<xs:element name="Tod" type="string30"/>
<xs:element name="InvOrder" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="string20"/>
<xs:element name="Item" type="string20"/>
<xs:element name="Qty" type="xs:int"/>
<xs:element name="Priority" type="xs:int"/>
<xs:element name="Reordering" type="xs:int"/>
<xs:element name="DelDate" type="string8"/>
<xs:element name="HlOrder" type="string20"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="InvOrderKey">
<xs:selector xpath="InvOrder"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="CustomerKey">
<xs:selector xpath="Customer"/>
<xs:field xpath="Seq"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="PickWaveKey">
<xs:selector xpath="PickWave"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="ProdRunKey">
<xs:selector xpath="ProdRun"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Here is the included sub-schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="string2">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string5">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="5"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string6">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="6"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string8">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string10">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string15">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string20">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string30">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string40">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string50">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string250">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="250"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
The statement for creating my table is
CREATE TABLE "XML_ORDERS"
("ID" NUMBER(7,0) NOT NULL ENABLE,
"XMLFILE" "SYS"."XMLTYPE" ,
"INSERTED" DATE DEFAULT sysdate,
CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
XMLSCHEMA "private/PickData.xsd" ELEMENT "PickData"
Here is a simple instance document:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PickData xsi:noNamespaceSchemaLocation="private/PickData.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ProdRun>
<Nr>5</Nr>
<Date>15112005</Date>
<Final>1</Final>
<PickWave>
<Nr>IPW0000017</Nr>
<ProdLine>01</ProdLine>
<TourSeq>1</TourSeq>
<Tour>00000043_078</Tour>
<Customer>
<Seq>5</Seq>
<Cust>100000006</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000457</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000742</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000459</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000742</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>6</Seq>
<Cust>100000013</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000461</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000743</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000463</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000743</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>2</Seq>
<Cust>100000114</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000465</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000744</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000467</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000744</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>3</Seq>
<Cust>100000140</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000469</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000745</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000471</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000745</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>7</Seq>
<Cust>100000143</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000473</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000746</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000475</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000746</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>8</Seq>
<Cust>100000145</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000477</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000747</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000479</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000747</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>9</Seq>
<Cust>100000146</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000481</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000748</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000483</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000748</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>4</Seq>
<Cust>100000147</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000485</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000750</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000487</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000750</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>10</Seq>
<Cust>100000148</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000489</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000751</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000491</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000751</HlOrder>
</InvOrder>
</Customer>
</PickWave>
</ProdRun>
</PickData>
When I registered the XMLSchema, the following types and tables were automatically created and you can see the hierarchy below:
(by the way, I could not find any xdb_utilities.printNestedTables mentioned elsewhere)
XML_ORDERS
|_PickData381_T
|___ProdRun382_T
|_____PickWave388_COLL
|_______PickWave383_T
|_________Customer387_COLL
|___________Customer384_T
|_____________InvOrder386_COLL
These objects are then used in the following nested tables:
TABLE_NAME TABLE_TYPE_NAME PARENT_TABLE_NAME PARENT_TABLE_COLUMN
SYS_NTaK/5zar5S0WitSsgu6OKPQ== PickWave388_COLL PickData389_TAB "XMLDATA"."ProdRun"."PickWave"
SYS_NTf6QvwVm8SFKz+K/YYWq+WQ== Item408_COLL ProdData409_TAB "XMLDATA"."Item"
SYS_NTtu05ilrRQqmuEN4k+07VDA== Customer402_COLL OutboundParty403_TAB "XMLDATA"."Customer"
SYS_NTK6fhWq5uTJ+vKcgBpNm1Fg== InvOrder386_COLL SYS_NTIIzv7bkXQSSS43igtfi5eg== InvOrder
SYS_NTIIzv7bkXQSSS43igtfi5eg== Customer387_COLL SYS_NTaK/5zar5S0WitSsgu6OKPQ== Customer
I enabled sql tracing and I got the following TKPROF output
INSERT INTO IMP_ORDERS (PICK_INVORDERNR, PICK_ITEM, PICK_QTY, PICK_PRIORITY,
PICK_REORDERING, PICK_HLORDER, PICK_DELDATE, PICK_CUST, PICK_MOD, PICK_TOD,
PICK_SEQ, PICK_PICKWAVENR, PICK_PICKWAVEPRODLINE, PICK_PICKWAVETOUR,
PICK_PICKWAVETOURSEQ, PICK_ORDKEY, PICK_RUNKEY) SELECT INVORDERNR, ITEM,
QTY, PRIORITY, REORDERING, HLORDER, DELDATE, CUST, MOD, TOD, SEQ,
PICKWAVENR, PICKWAVEPRODLINE, PICKWAVETOUR, PICKWAVETOURSEQ, ROWNUM AS
PICK_ORDKEY, PRODRUNID FROM (SELECT /*+ cardinality(g 15)*/
EXTRACTVALUE(VALUE(G), '/InvOrder/Nr') AS INVORDERNR, EXTRACTVALUE(VALUE(G),
'/InvOrder/Item') AS ITEM, EXTRACTVALUE(VALUE(G), '/InvOrder/Qty') AS QTY,
EXTRACTVALUE(VALUE(G), '/InvOrder/Priority') AS PRIORITY,
EXTRACTVALUE(VALUE(G), '/InvOrder/Reordering') AS REORDERING,
EXTRACTVALUE(VALUE(G), '/InvOrder/HlOrder') AS HLORDER,
TO_DATE(EXTRACTVALUE(VALUE(G), '/InvOrder/DelDate'),'DDMMYYYY') AS DELDATE,
F.CUST, F.MOD, F.TOD, F.SEQ, F.PICKWAVENR, F.PICKWAVEPRODLINE,
F.PICKWAVETOUR, F.PICKWAVETOURSEQ, F.PRODRUNNR, F.PRODRUNDATE,
F.PRODRUNFINAL, F.PRODRUNID FROM (SELECT /*+ cardinality(e 60)*/VALUE(E) AS
CUSTOMERNODE, EXTRACTVALUE(VALUE(E), '/Customer/Cust') AS CUST,
EXTRACTVALUE(VALUE(E), '/Customer/Mod') AS MOD, EXTRACTVALUE(VALUE(E),
'/Customer/Tod') AS TOD, TO_NUMBER(EXTRACTVALUE(VALUE(E), '/Customer/Seq'))
AS SEQ, D.PICKWAVENR, D.PICKWAVEPRODLINE, D.PICKWAVETOUR, D.PICKWAVETOURSEQ,
D.PRODRUNNR, D.PRODRUNDATE, D.PRODRUNFINAL, D.PRODRUNID FROM (SELECT /*+
cardinality(c 100)*/VALUE(C) AS PICKWAVENODE, EXTRACTVALUE(VALUE(C),
'/PickWave/Nr') AS PICKWAVENR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
'/PickWave/ProdLine')) AS PICKWAVEPRODLINE, EXTRACTVALUE(VALUE(C),
'/PickWave/Tour') AS PICKWAVETOUR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
'/PickWave/TourSeq')) AS PICKWAVETOURSEQ, A.PRODRUNNR, A.PRODRUNDATE,
A.PRODRUNFINAL, A.PRODRUNID FROM (SELECT /*+ cardinality(b 1)*/VALUE(B) AS
PRODRUNNODE, EXTRACTVALUE(VALUE(B), '/ProdRun/Nr') AS PRODRUNNR,
TO_DATE(EXTRACTVALUE(VALUE(B), '/ProdRun/Date'),'DDMMYYYY') AS PRODRUNDATE,
EXTRACTVALUE(VALUE(B), '/ProdRun/Final') AS PRODRUNFINAL, X.ID PRODRUNID
FROM XML_ORDERS X, TABLE(XMLSEQUENCE(EXTRACT(X.XMLFILE,'/PickData/ProdRun'))
) B WHERE X.ID = :B1 ) A, TABLE(XMLSEQUENCE(EXTRACT(A.PRODRUNNODE,
'/ProdRun/PickWave'))) C ) D, TABLE(XMLSEQUENCE(EXTRACT(D.PICKWAVENODE,
'/PickWave/Customer'))) E ) F, TABLE(XMLSEQUENCE(EXTRACT(F.CUSTOMERNODE,
'/Customer/InvOrder'))) G ORDER BY PICKWAVEPRODLINE, PICKWAVETOURSEQ,
PICKWAVENR, SEQ )
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 4324.09 9994.65 0 57193 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 4324.09 9994.65 0 57193 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 68 (recursive depth: 1)
Rows Row Source Operation
0 COUNT (cr=0 pr=0 pw=0 time=180 us)
0 VIEW (cr=0 pr=0 pw=0 time=166 us)
0 SORT ORDER BY (cr=0 pr=0 pw=0 time=152 us)
40866 NESTED LOOPS (cr=54973 pr=0 pw=0 time=31065606 us)
1363 NESTED LOOPS (cr=54937 pr=0 pw=0 time=11037183 us)
1 NESTED LOOPS (cr=54889 pr=0 pw=0 time=10145883 us)
1 NESTED LOOPS (cr=54841 pr=0 pw=0 time=9799012 us)
1 TABLE ACCESS BY INDEX ROWID XML_ORDERS (cr=2 pr=0 pw=0 time=222 us)
1 INDEX UNIQUE SCAN XML_ORDERS_PK (cr=1 pr=0 pw=0 time=126 us)(object id 58551)
1 COLLECTION ITERATOR PICKLER FETCH (cr=54839 pr=0 pw=0 time=9798748 us)
1 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=346818 us)
1363 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=870830 us)
40866 COLLECTION ITERATOR PICKLER FETCH (cr=36 pr=0 pw=0 time=18739302 us)
Note that I cancelled this operation before it was over so I imagine that these figures refer to the statistics as of the time when the operation was interrupted.
So, here are finally my questions.
In order to create the constraints on the nested tables as shown in other threads, do I need to drop the existing xml_orders table and ancillary object types and recreate them or is there a way to add such constraints using the existing system generated object names?
Secondly, the xml_orders table may contain severale documents, not just one and his current primary key is the column ID. So, in order to uniquely identify the deepest element in the xml document, I need first to select the relevant document by means of the id column.
Would it be better to create the indexes containing this id column together with the nested_table_id and array_index?
Thanks for you help.
Flavio
PS: I wrote a 10 lines xsl transformation that I passed on to Saxon together with the 32Mb file. It took less than 1 minute to produce a flat file that was loaded almost instantly by SQL*Loader. So, what I am looking for is a procedure loading this stuff in less than 2 minutes or possibly less.Does the following help
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:53 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool registerSchema_&4..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/xsd/&4',
5 bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/xsd/&4',
new 4: result := dbms_xdb.createResource('/home/OTNTEST/xsd/GetaxTypes.xsd',
old 5: bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'GetaxTypes.xsd'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
SQL> commit
2 /
Commit complete.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaURL => '&3',
5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => &5
10 );
11 end;
12 /
old 4: schemaURL => '&3',
new 4: schemaURL => 'private/GetaxTypes.xsd',
old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/GetaxTypes.xsd').getClob(),
old 9: genTables => &5
new 9: genTables => TRUE
PL/SQL procedure successfully completed.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:55 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool registerSchema_&4..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/xsd/&4',
5 bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/xsd/&4',
new 4: result := dbms_xdb.createResource('/home/OTNTEST/xsd/PickData.xsd',
old 5: bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'PickData.xsd'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
SQL> commit
2 /
Commit complete.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaURL => '&3',
5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => &5
10 );
11 end;
12 /
old 4: schemaURL => '&3',
new 4: schemaURL => 'private/PickData.xsd',
old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/PickData.xsd').getClob(),
old 9: genTables => &5
new 9: genTables => TRUE
PL/SQL procedure successfully completed.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:58 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool createTable.log
SQL> --
SQL> connect &1/&2
Connected.
SQL> --
SQL> CREATE TABLE "XML_ORDERS"
2 ("ID" NUMBER(7,0) NOT NULL ENABLE,
3 "XMLFILE" "SYS"."XMLTYPE" ,
4 "INSERTED" DATE DEFAULT sysdate,
5 CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
6 ) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
7 XMLSCHEMA "private/PickData.xsd"
8 ELEMENT "PickData"
9 VARRAY XMLFILE."XMLDATA"."ProdRun"."PickWave" STORE AS TABLE PickWave_TAB
10 (
11 ( primary key (nested_table_id, array_index)
12 ) organization index overflow
13 VARRAY "Customer" STORE AS TABLE Customer_TAB
14 (
15 (primary key (nested_table_id, array_index)
16 ) organization index overflow
17 VARRAY "InvOrder" STORE AS TABLE InvOrder_TAB
18 (
19 (primary key (nested_table_id, array_index)
20 ) organization index overflow
21 )
22 )
23 )
24 /
Table created.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool insertFile_&3..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> --
SQL> insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
2 /
old 1: insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
new 1: insert into XML_ORDERS (ID, XMLFILE) values (10, xmltype(bfilename(USER,'testcase.xml'),nls_charset_id('AL32UT
8')))
1 row created.
Elapsed: 00:00:00.11
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.01
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool testcase.log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> set pages 0 lines 140
SQL> --
SQL> -- Testcase code here
SQL> --
SQL> set autotrace on explain
SQL> --
SQL> create or replace view PROD_RUN_VIEW
2 (
3 PRODRUNNODE,
4 PRODRUNNR,
5 PRODRUNDATE,
6 PRODRUNID,
7 PRODRUNFINAL
8 )
9 as
10 select EXTRACT(XMLFILE,'/PickData/ProdRun'),
11 EXTRACTVALUE(XMLFILE , '/PickData/ProdRun/Nr'),
12 TO_DATE(EXTRACTVALUE(XMLFILE, '/PickData/ProdRun/Date'),'DDMMYYYY'),
13 ID,
14 EXTRACTVALUE(XMLFILE,'/PickData/ProdRun/Final')
15 from XML_ORDERS
16 /
View created.
Elapsed: 00:00:00.09
SQL> create or replace view PICK_WAVE_VIEW
2 (
3 PICKWAVENODE,
4 PICKWAVENR,
5 PICKWAVEPRODLINE,
6 PICKWAVETOUR,
7 PICKWAVETOURSEQ,
8 PRODRUNNR,
9 PRODRUNDATE,
10 PRODRUNID,
11 PRODRUNFINAL
12 )
13 as
14 select value(PW),
15 extractValue(value(PW),'/PickWave/Nr'),
16 TO_NUMBER(EXTRACTVALUE(value(PW),'/PickWave/ProdLine')),
17 extractValue(value(PW),'/PickWave/Tour'),
18 TO_NUMBER(extractValue(value(PW),'/PickWave/TourSeq')),
19 PRODRUNNR,
20 PRODRUNDATE,
21 PRODRUNID,
22 PRODRUNFINAL
23 FROM PROD_RUN_VIEW, table(xmlsequence(extract(PRODRUNNODE,'/ProdRun/PickWave'))) PW
24 /
View created.
Elapsed: 00:00:00.09
SQL> create or replace view CUSTOMER_VIEW
2 (
3 CUSTOMERNODE,
4 CUST,
5 MOD,
6 TOD,
7 SEQ,
8 PICKWAVENR,
9 PICKWAVEPRODLINE,
10 PICKWAVETOUR,
11 PICKWAVETOURSEQ,
12 PRODRUNNR,
13 PRODRUNDATE,
14 PRODRUNFINAL,
15 PRODRUNID
16 )
17 as
18 select value(CUST),
19 EXTRACTVALUE(VALUE(CUST), '/Customer/Cust'),
20 EXTRACTVALUE(VALUE(CUST), '/Customer/Mod'),
21 EXTRACTVALUE(VALUE(CUST), '/Customer/Tod'),
22 TO_NUMBER(EXTRACTVALUE(VALUE(CUST), '/Customer/Seq')),
23 PICKWAVENR,
24 PICKWAVEPRODLINE,
25 PICKWAVETOUR,
26 PICKWAVETOURSEQ,
27 PRODRUNNR,
28 PRODRUNDATE,
29 PRODRUNFINAL,
30 PRODRUNID
31 from PICK_WAVE_VIEW, table(xmlsequence(extract(PICKWAVENODE,'/PickWave/Customer'))) CUST
32 /
View created.
Elapsed: 00:00:00.10
SQL>
SQL> create or replace view INVOICE_ORDER_VIEW
2 (
3 INVORDERNR,
4 ITEM,
5 QTY,
6 PRIORITY,
7 REORDERING,
8 HLORDER,
9 DELDATE,
10 CUST,
11 MOD,
12 TOD,
13 SEQ,
14 PICKWAVENR,
15 PICKWAVEPRODLINE,
16 PICKWAVETOUR,
17 PICKWAVETOURSEQ,
18 PRODRUNNR,
19 PRODRUNDATE,
20 PRODRUNFINAL,
21 PRODRUNID
22 )
23 as
24 SELECT EXTRACTVALUE(VALUE(INV), '/InvOrder/Nr'),
25 EXTRACTVALUE(VALUE(INV), '/InvOrder/Item'),
26 EXTRACTVALUE(VALUE(INV), '/InvOrder/Qty'),
27 EXTRACTVALUE(VALUE(INV), '/InvOrder/Priority'),
28 EXTRACTVALUE(VALUE(INV), '/InvOrder/Reordering'),
29 EXTRACTVALUE(VALUE(INV), '/InvOrder/HlOrder'),
30 TO_DATE(EXTRACTVALUE(VALUE(INV), '/InvOrder/DelDate'),'DDMMYYYY'),
31 CUST,
32 MOD,
33 TOD,
34 SEQ,
35 PICKWAVENR,
36 PICKWAVEPRODLINE,
37 PICKWAVETOUR,
38 PICKWAVETOURSEQ,
39 PRODRUNNR,
40 PRODRUNDATE,
41 PRODRUNFINAL,
42 PRODRUNID
43 FROM CUSTOMER_VIEW, table(xmlsequence(extract(CUSTOMERNODE,'Customer/InvOrder'))) INV
44 /
View created.
Elapsed: 00:00:00.13
SQL> select * from INVOICE_ORDER_VIEW
2 /
IIO0000461 100000036 20 1 0 CSO000743 15-NOV-05 100000013
FO DDU 6 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000463 100000045 20 1 0 CSO000743 15-NOV-05 100000013
FO DDU 6 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000473 100000036 20 1 0 CSO000746 15-NOV-05 100000143
FO DDU 7 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000475 100000045 20 1 0 CSO000746 15-NOV-05 100000143
FO DDU 7 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000469 100000036 20 1 0 CSO000745 15-NOV-05 100000140
FO DDU 3 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000471 100000045 20 1 0 CSO000745 15-NOV-05 100000140
FO DDU 3 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000489 100000036 20 0 0 CSO000751 15-NOV-05 100000148
FO DDU 10 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000491 100000045 20 1 0 CSO000751 15-NOV-05 100000148
FO DDU 10 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000481 100000036 20 0 0 CSO000748 15-NOV-05 100000146
FO DDU 9 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000483 100000045 20 1 0 CSO000748 15-NOV-05 100000146
FO DDU 9 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000485 100000036 20 0 0 CSO000750 15-NOV-05 100000147
FO DDU 4 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000487 100000045 20 1 0 CSO000750 15-NOV-05 100000147
FO DDU 4 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000457 100000036 20 1 0 CSO000742 15-NOV-05 100000006
FO DDU 5 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000459 100000045 20 1 0 CSO000742 15-NOV-05 100000006
FO DDU 5 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000477 100000036 20 1 0 CSO000747 15-NOV-05 100000145
FO DDU 8 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000479 100000045 20 1 0 CSO000747 15-NOV-05 100000145
FO DDU 8 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000465 100000036 20 1 0 CSO000744 15-NOV-05 100000114
FO DDU 2 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000467 100000045 20 1 0 CSO000744 15-NOV-05 100000114
FO DDU 2 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
18 rows selected.
Elapsed: 00:00:00.22
Execution Plan
Plan hash value: 1730223965
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 18 | 10278 | 877 (0)| 00:00:11 |
| 1 | NESTED LOOPS | | 18 | 10278 | 877 (0)| 00:00:11 |
| 2 | NESTED LOOPS | | 18 | 8424 | 841 (0)| 00:00:11 |
| 3 | MERGE JOIN CARTESIAN | | 18 | 4680 | 805 (0)| 00:00:10 |
| 4 | TABLE ACCESS FULL | XML_ORDERS | 1 | 67 | 3 (0)| 00:00:01 |
| 5 | BUFFER SORT | | 18 | 3474 | 802 (0)| 00:00:10 |
| 6 | INDEX FAST FULL SCAN| SYS_IOT_TOP_64187 | 18 | 3474 | 802 (0)| 00:00:10 |
|* 7 | INDEX UNIQUE SCAN | SYS_IOT_TOP_64185 | 1 | 208 | 2 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | SYS_C008783 | 1 | | 0 (0)| 00:00:01 |
|* 9 | INDEX UNIQUE SCAN | SYS_IOT_TOP_64183 | 1 | 103 | 2 (0)| 00:00:01 |
|* 10 | INDEX RANGE SCAN | SYS_C008785 | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
7 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
8 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
9 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
filter("NESTED_TABLE_ID"="XML_ORDERS"."SYS_NC0001000011$")
10 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
Note
- dynamic sampling used for this statement
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
C:\oracle\xdb\otn\347125>You were sequencing the ProdRun node, which is a mistake. Only nodes which occur multiple times should be sequenced... -
Error while adding XML Schemas with cyclic references
I have to use the 3rd party bunch of XML Schema files, but two of them reference each other, i.e. there are cyclic references. ESB displays a conflict in this case.
Is there any way to resolve the problem without changing source xsd-files?
My configuration is WebLogic Platform 9.2.1 + AquaLogic Service Bus 2.6Our scenario is that the corporate data model (in UML) is transformed into XSD and delivered as several separate XSD files. Our modellers argue that cyclic references make sense in this context and are not forbidden by the standard.
We restructured the transformation so that only a single XSD file is delivered (~550K) but this is unwieldy, inflexible and ALSB is sloooooooooow when manipulating a schema of this size inside the console. -
Error while registring xml schema
Hi,
I am trying to register following xml schema,
BEGIN
dbms_xmlschema.registerSchema(
'ocastatus.xsd',
'<?xml version="1.0"?>
<xsd:schema
targetNamespace="http://xmlbeans.apache.org/ocastatus"
xmlns="http://xmlbeans.apache.org/ocastatus"
elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb">
<xsd:element name="ocaStatus" type="OCASTATUS_TYPEType"/>
<xsd:complexType name="OCASTATUS_TYPEType" xdb:SQLType="OCASTATUS_TYPE">
<xsd:sequence>
<xsd:element name="status" type="STATUS_TYPEType" xdb:SQLName="status" maxOccurs="unbounded" xdb:SQLCollType="STATUS_V"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="STATUS_TYPEType" xdb:SQLType="STATUS_TYPE">
<xsd:sequence>
<xsd:element name="statusCode" type="xsd:double" xdb:SQLName="statusCode" xdb:SQLType="NUMBER"/>
<xsd:element name="statusDate" xdb:SQLName="statusDate" xdb:SQLType="VARCHAR2">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="userId" xdb:SQLName="userId" xdb:SQLType="VARCHAR2">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="comment" xdb:SQLName="comment" xdb:SQLType="VARCHAR2">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>',
true,
true,
false);
END;
While doing so, I am getting following error,
ORA-20001: enable_hierarchy_internal
ORA-06512: at "XDB.DBMS_XDBZ", line 28
ORA-06512: at line 1
ORA-06512: at "XDB.DBMA_XMLSCHEMA_INT", line 3
ORA-06512: at "XDB.DBMA_XMLSCHEMA", line 14
ORA-06512: at line 2
Vendor code 20001 Error at line: 1
I have no clue about this errors. I don't know if it is linked to user privileges.
The user I am using has following privileges,
CREATE SESSION
CREATE TABLE
CREATE CLUSTER
CREATE SEQUENCE
CREATE PROCEDURE
CREATE TRIGGER
CREATE TYPE
CREATE OPERATOR
CREATE INDEXTYPE
Please help.
Thanks in advance.I would need the full database version (all digits) to be able to answer it, so could you please provide this.
The other, strange thing, in this example that you gave is the ORA-20001 error... This is not (afaik) an Oracle thrown error but a user defined error as shown, for example, in this post http://www.dbmotive.com/oracle_error_codes.php?errcode=20001.
As it is, IMHO, correctly stated in that post:
Error messages starting from -20000 until -20999 are user specified error messages.
Oracle provides these range of codes so applications can raise an application specific error, which will be displayed after the chosen code.
This is done using the raise_application_error pl/sql function.
You'll have to contact the application provider should you want to have more detail about the error message.
Unless the error message is of an Oracle application or functionality, it is useless to contact Oracle for these errors. -
Error when registering XML Schema
When I try to register a schema with XDB I keep getting an ORA-31000 error. It says that the schema it references is not a valid XDB schema, but when I try to register that one it says the first one isn't valid.
Testing with 11g I get
I assume you have registered 'http://www.w3.org/2005/08/addressing/ws-addr.xsd'
SQL> set echo on
SQL> spool testcase.log
SQL> --
SQL> connect sys/ as sysdba
Enter password:
Connected.
SQL> set define on
SQL> set timing on
SQL> --
SQL> define USERNAME = IXSEMF01
SQL> --
SQL> def PASSWORD = IXSEMF01
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user IXSEMF01 cascade
drop user IXSEMF01 cascade
ERROR at line 1:
ORA-01918: user 'IXSEMF01' does not exist
Elapsed: 00:00:00.03
SQL> grant connect, resource to &USERNAME identified by &PASSWORD
2 /
old 1: grant connect, resource to &USERNAME identified by &PASSWORD
new 1: grant connect, resource to IXSEMF01 identified by IXSEMF01
Grant succeeded.
Elapsed: 00:00:00.01
SQL> grant create any directory, drop any directory to &USERNAME
2 /
old 1: grant create any directory, drop any directory to &USERNAME
new 1: grant create any directory, drop any directory to IXSEMF01
Grant succeeded.
Elapsed: 00:00:00.00
SQL> grant alter session, create view to &USERNAME
2 /
old 1: grant alter session, create view to &USERNAME
new 1: grant alter session, create view to IXSEMF01
Grant succeeded.
Elapsed: 00:00:00.00
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new 1: alter user IXSEMF01 default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.00
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> alter session set events ='19027 trace name context forever, level 0x800'
2 /
Session altered.
Elapsed: 00:00:00.00
SQL> var schemaURL varchar2(700)
SQL> var schemaURL1 varchar2(700)
SQL> var schemaURL2 varchar2(700)
SQL> var xmlschema CLOB
SQL> --
SQL> begin
2 :schemaURL := 'http://www.w3.org/2005/08/addressing/ws-addr.xsd';
3 :xmlSchema :=
4 '<?xml version="1.0" encoding="utf-8"?>
5 <!--
6 <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
7 W3C XML Schema defined in the Web Services Addressing 1.0 specification
8 http://www.w3.org/TR/ws-addr-core
9
10 Copyright c 2005 World Wide Web Consortium,
11
12 (Massachusetts Institute of Technology, European Research Consortium for
13 Informatics and Mathematics, Keio University). All Rights Reserved. This
14 work is distributed under the W3Cr Software License [1] in the hope that
15 it will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
19
20 $Id: ws-addr.xsd,v 1.3 2005/08/09 13:17:35 hugo Exp $
21 -->
22 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2005/08/addressing" targetNamespace="http://www.w3.
org/2005/08/addressing" blockDefault="#all" elementFormDefault="qualified" finalDefault="" attributeFormDefault="unqualified">
23
24 <!-- Constructs from the WS-Addressing Core -->
25
26 <xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
27 <xs:complexType name="EndpointReferenceType" mixed="false">
28 <xs:sequence>
29 <xs:element name="Address" type="tns:AttributedURIType"/>
30 <xs:element name="ReferenceParameters" type="tns:ReferenceParametersType" minOccurs="0"/>
31 <xs:element ref="tns:Metadata" minOccurs="0"/>
32 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
33 </xs:sequence>
34 <xs:anyAttribute namespace="##other" processContents="lax"/>
35 </xs:complexType>
36
37 <xs:complexType name="ReferenceParametersType" mixed="false">
38 <xs:sequence>
39 <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
40 </xs:sequence>
41 <xs:anyAttribute namespace="##other" processContents="lax"/>
42 </xs:complexType>
43
44 <xs:element name="Metadata" type="tns:MetadataType"/>
45 <xs:complexType name="MetadataType" mixed="false">
46 <xs:sequence>
47 <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
48 </xs:sequence>
49 <xs:anyAttribute namespace="##other" processContents="lax"/>
50 </xs:complexType>
51
52 <xs:element name="MessageID" type="tns:AttributedURIType"/>
53 <xs:element name="RelatesTo" type="tns:RelatesToType"/>
54 <xs:complexType name="RelatesToType" mixed="false">
55 <xs:simpleContent>
56 <xs:extension base="xs:anyURI">
57 <xs:attribute name="RelationshipType" type="tns:RelationshipTypeOpenEnum" use="optional" default="http://www
.w3.org/2005/08/addressing/reply"/>
58 <xs:anyAttribute namespace="##other" processContents="lax"/>
59 </xs:extension>
60 </xs:simpleContent>
61 </xs:complexType>
62
63 <xs:simpleType name="RelationshipTypeOpenEnum">
64 <xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
65 </xs:simpleType>
66
67 <xs:simpleType name="RelationshipType">
68 <xs:restriction base="xs:anyURI">
69 <xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
70 </xs:restriction>
71 </xs:simpleType>
72
73 <xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
74 <xs:element name="From" type="tns:EndpointReferenceType"/>
75 <xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
76 <xs:element name="To" type="tns:AttributedURIType"/>
77 <xs:element name="Action" type="tns:AttributedURIType"/>
78
79 <xs:complexType name="AttributedURIType" mixed="false">
80 <xs:simpleContent>
81 <xs:extension base="xs:anyURI">
82 <xs:anyAttribute namespace="##other" processContents="lax"/>
83 </xs:extension>
84 </xs:simpleContent>
85 </xs:complexType>
86
87 <!-- Constructs from the WS-Addressing SOAP binding -->
88
89 <xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
90
91 <xs:simpleType name="FaultCodesOpenEnumType">
92 <xs:union memberTypes="tns:FaultCodesType xs:QName"/>
93 </xs:simpleType>
94
95 <xs:simpleType name="FaultCodesType">
96 <xs:restriction base="xs:QName">
97 <xs:enumeration value="tns:InvalidAddressingHeader"/>
98 <xs:enumeration value="tns:InvalidAddress"/>
99 <xs:enumeration value="tns:InvalidEPR"/>
100 <xs:enumeration value="tns:InvalidCardinality"/>
101 <xs:enumeration value="tns:MissingAddressInEPR"/>
102 <xs:enumeration value="tns:DuplicateMessageID"/>
103 <xs:enumeration value="tns:ActionMismatch"/>
104 <xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
105 <xs:enumeration value="tns:DestinationUnreachable"/>
106 <xs:enumeration value="tns:ActionNotSupported"/>
107 <xs:enumeration value="tns:EndpointUnavailable"/>
108 </xs:restriction>
109 </xs:simpleType>
110
111 <xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
112 <xs:complexType name="AttributedUnsignedLongType" mixed="false">
113 <xs:simpleContent>
114 <xs:extension base="xs:unsignedLong">
115 <xs:anyAttribute namespace="##other" processContents="lax"/>
116 </xs:extension>
117 </xs:simpleContent>
118 </xs:complexType>
119
120 <xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
121 <xs:complexType name="AttributedQNameType" mixed="false">
122 <xs:simpleContent>
123 <xs:extension base="xs:QName">
124 <xs:anyAttribute namespace="##other" processContents="lax"/>
125 </xs:extension>
126 </xs:simpleContent>
127 </xs:complexType>
128
129 <xs:element name="ProblemHeader" type="tns:AttributedAnyType"/>
130 <xs:complexType name="AttributedAnyType" mixed="false">
131 <xs:sequence>
132 <xs:any namespace="##any" processContents="lax" minOccurs="1" maxOccurs="1"/>
133 </xs:sequence>
134 <xs:anyAttribute namespace="##other" processContents="lax"/>
135 </xs:complexType>
136
137 <xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
138
139 <xs:element name="ProblemAction" type="tns:ProblemActionType"/>
140 <xs:complexType name="ProblemActionType" mixed="false">
141 <xs:sequence>
142 <xs:element ref="tns:Action" minOccurs="0"/>
143 <xs:element name="SoapAction" minOccurs="0" type="xs:anyURI"/>
144 </xs:sequence>
145 <xs:anyAttribute namespace="##other" processContents="lax"/>
146 </xs:complexType>
147
148 </xs:schema>';
149 end;
150 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> declare
2 xmlschema xmltype := xmltype(:xmlschema);
3 begin
4 dbms_xmlschema.registerSchema
5 (
6 schemaURL => :schemaURL
7 ,schemaDoc => xmlschema
8 ,local => TRUE
9 ,genBean => false
10 ,genTypes => TRUE
11 ,genTables => TRUE
12 );
13 end;
14 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.07
SQL>
SQL> begin
2 :schemaURL1 := 'muws1-2.xsd';
3 :xmlSchema :=
4 '<?xml version="1.0" encoding="utf-8"?>
5 <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Dirk Grissett (Oracle Corp.) --> <xs:schema xmlns:muws1="http://docs.
oasis-open.org/wsdm/muws1-2.xsd" xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/wsdm/muws1-2.xsd" elementFormDefault="qualified" att
ributeFormDefault="unqualified">
6 <xs:import namespace="http://docs.oasis-open.org/wsdm/muws2-2.xsd" schemaLocation="muws2-2.xsd"/>
7 <xs:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="http://www.w3.org/2005/08/addressing/ws-addr.xsd"/>
8 <xs:element name="ResourceId" type="xs:anyURI"/>
9 <xs:element name="ManageabilityCapability" type="xs:anyURI"/>
10 <xs:complexType name="CorrelatablePropertiesType">
11 <xs:sequence>
12 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
13 </xs:sequence>
14 <xs:attribute name="Dialect" type="xs:anyURI"/>
15 <xs:attribute name="NegativeAssertionPossible" type="xs:boolean"/>
16 <xs:anyAttribute namespace="##other"/>
17 </xs:complexType>
18 <xs:element name="CorrelatableProperties" type="muws1:CorrelatablePropertiesType"/>
19 <xs:complexType name="ComponentAddressType">
20 <xs:sequence>
21 <xs:element name="ManagementURL" type="xs:string"/>
22 <xs:any namespace="##any" processContents="lax"/>
23 </xs:sequence>
24 </xs:complexType>
25 <xs:complexType name="ComponentType">
26 <xs:sequence>
27 <xs:element name="ResourceId" type="xs:anyURI" minOccurs="0"/>
28 <xs:element name="ComponentAddress" type="muws1:ComponentAddressType" minOccurs="0"/>
29 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
30 </xs:sequence>
31 <xs:anyAttribute namespace="##other"/>
32 </xs:complexType>
33 <xs:complexType name="ManagementEventType">
34 <xs:sequence>
35 <xs:element name="EventId" type="xs:anyURI"/>
36 <xs:element name="SourceComponent" type="muws1:ComponentType"/>
37 <xs:element name="ReporterComponent" type="muws1:ComponentType" minOccurs="0"/>
38 <xs:element ref="muws2:Situation"/>
39 <xs:element name="ExtendedData" type="muws1:ExtendedDataType" minOccurs="0" maxOccurs="unbounded"/>
40 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
41 </xs:sequence>
42 <xs:attribute name="ReportTime" type="xs:dateTime" use="optional"/>
43 <xs:anyAttribute namespace="##other"/>
44 </xs:complexType>
45 <xs:element name="ManagementEvent" type="muws1:ManagementEventType"/>
46 <xs:element name="ManageabilityEndpointReference" type="wsa:EndpointReferenceType"/>
47 <xs:complexType name="ExtendedDataElementType">
48 <xs:sequence>
49 <xs:choice>
50 <xs:element name="values" minOccurs="0">
51 <xs:simpleType>
52 <xs:restriction base="xs:string">
53 <xs:maxLength value="1024"/>
54 </xs:restriction>
55 </xs:simpleType>
56 </xs:element>
57 <xs:element name="hexValue" type="xs:hexBinary" minOccurs="0"/>
58 <xs:element name="intValues" type="xs:int" minOccurs="0"/>
59 <xs:element name="longValues" type="xs:long" minOccurs="0"/>
60 <xs:element name="shortValues" type="xs:short" minOccurs="0"/>
61 <xs:element name="dateTimeValues" type="xs:dateTime" minOccurs="0"/>
62 <xs:element name="byteValues" type="xs:byte" minOccurs="0"/>
63 <xs:element name="booleanValues" type="xs:boolean" minOccurs="0"/>
64 <xs:element name="floatValues" type="xs:float" minOccurs="0"/>
65 <xs:element name="doubleValues" type="xs:double" minOccurs="0"/>
66 <xs:element name="largeStringValue" type="xs:string" minOccurs="0"/>
67 </xs:choice>
68 </xs:sequence>
69 <xs:attribute name="name" use="required">
70 <xs:simpleType>
71 <xs:restriction base="xs:Name">
72 <xs:maxLength value="64"/>
73 </xs:restriction>
74 </xs:simpleType>
75 </xs:attribute>
76 <xs:attribute name="type" use="required">
77 <xs:simpleType>
78 <xs:restriction base="xs:string">
79 <xs:enumeration value="noValue"/>
80 <xs:enumeration value="byte"/>
81 <xs:enumeration value="short"/>
82 <xs:enumeration value="int"/>
83 <xs:enumeration value="long"/>
84 <xs:enumeration value="float"/>
85 <xs:enumeration value="double"/>
86 <xs:enumeration value="string"/>
87 <xs:enumeration value="dateTime"/>
88 <xs:enumeration value="boolean"/>
89 <xs:enumeration value="byteArray"/>
90 <xs:enumeration value="shortArray"/>
91 <xs:enumeration value="intArray"/>
92 <xs:enumeration value="longArray"/>
93 <xs:enumeration value="floatArray"/>
94 <xs:enumeration value="doubleArray"/>
95 <xs:enumeration value="stringArray"/>
96 <xs:enumeration value="dateTimeArray"/>
97 <xs:enumeration value="booleanArray"/>
98 <xs:enumeration value="hexBinary"/>
99 <xs:enumeration value="largeStringValue"/>
100 </xs:restriction>
101 </xs:simpleType>
102 </xs:attribute>
103 </xs:complexType>
104 <xs:complexType name="ExtendedDataType">
105 <xs:sequence>
106 <xs:element name="ExtendedDataElement" type="muws1:ExtendedDataElementType" minOccurs="0" maxOccurs="unbounded"/>
107 </xs:sequence>
108 <xs:attribute name="profile" type="xs:ID"/>
109 </xs:complexType>
110 <!--
111 SCHEMA COPY Material Copy and paste element references below into the schema of a resource prope
rties document.
112 These references are provide to insure that the correct minOccurs/maxOccurs attributes are specified in a resource property document sc
hema.
113
114 NOTE: You must import the MUWS Part 1 schema namespace (MUWS1).
115
116 ** Identity Properties **
117 <xs:element ref="muws1:ResourceId"/>
118
119
120 ** ManageabilityCharacteristics Properties **
121 <xs:element ref="muws1:ManageabilityCapability"
122 minOccurs="0" maxOccurs="unbounded"/>
123
124 ** Correlatable Properties **
125 <xs:element ref="muws1:CorrelatableProperties"
126 minOccurs="0" maxOccurs="unbounded"/>
127
128 -->
129 </xs:schema>';
130 end;
131 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> declare
2 xmlschema xmltype := xmltype(:xmlschema);
3 begin
4 dbms_xmlschema.registerSchema
5 (
6 schemaURL => :schemaURL1
7 ,schemaDoc => xmlschema
8 ,local => TRUE
9 ,genBean => false
10 ,genTypes => TRUE
11 ,genTables => TRUE
12 ,force => TRUE
13 );
14 end;
15 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.35
SQL> begin
2 :schemaURL2 := 'muws2-2.xsd';
3 :xmlSchema :=
4 '<?xml version="1.0" encoding="utf-8"?>
5 <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Dirk Grissett (Oracle Corp.) -->
6 <xs:schema xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd" xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" xmlns:ws
a="http://www.w3.org/2005/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/wsdm/muws2-
2.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified">
7 <xs:import namespace="http://docs.oasis-open.org/wsdm/muws1-2.xsd" schemaLocation="muws1-2.xsd"/>
8 <xs:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="http://www.w3.org/2005/08/addressing/ws-addr.xsd"/>
9 <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
10 <xs:complexType name="LangString">
11 <xs:simpleContent>
12 <xs:extension base="xs:string">
13 <xs:attribute ref="xml:lang" use="required"/>
14 <xs:anyAttribute namespace="##other"/>
15 </xs:extension>
16 </xs:simpleContent>
17 </xs:complexType>
18 <!-- Begin properties for the Description capability -->
19 <xs:element name="Caption" type="muws2:LangString"/>
20 <xs:element name="Description" type="muws2:LangString"/>
21 <xs:element name="Version" type="xs:string"/>
22 <!-- End properties for the Description capability -->
23 <xs:complexType name="CategoryType">
24 <xs:sequence>
25 <xs:any namespace="##any" processContents="lax" minOccurs="0"/>
26 </xs:sequence>
27 </xs:complexType>
28 <xs:complexType name="StateType">
29 <xs:complexContent>
30 <xs:extension base="muws2:CategoryType"/>
31 </xs:complexContent>
32 </xs:complexType>
33 <xs:element name="State" type="muws2:StateType"/>
34 <xs:element name="EnteredState" type="muws2:StateType"/>
35 <xs:element name="PreviousState" type="muws2:StateType"/>
36 <xs:complexType name="StateTransitionType">
37 <xs:sequence>
38 <xs:element ref="muws2:EnteredState"/>
39 <xs:element ref="muws2:PreviousState" minOccurs="0"/>
40 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
41 </xs:sequence>
42 <xs:attribute name="TransitionIdentifier" type="xs:anyURI" use="optional"/>
43 <xs:attribute name="Time" type="xs:dateTime" use="required"/>
44 <xs:anyAttribute namespace="##other"/>
45 </xs:complexType>
46 <xs:element name="StateTransition" type="muws2:StateTransitionType"/>
47 <!-- Begin properties for the OperationalStatus capability -->
48 <xs:element name="OperationalStatus">
49 <xs:simpleType>
50 <xs:restriction base="xs:string">
51 <xs:enumeration value="Available"/>
52 <xs:enumeration value="PartiallyAvailable"/>
53 <xs:enumeration value="Unavailable"/>
54 <xs:enumeration value="Unknown"/>
55 </xs:restriction>
56 </xs:simpleType>
57 </xs:element>
58 <!-- End properties for the OperationalStatus capability -->
59 <xs:attributeGroup name="MetricAttributes">
60 <xs:attribute name="ResetAt" type="xs:dateTime"/>
61 <xs:attribute name="LastUpdated" type="xs:dateTime"/>
62 <xs:attribute name="Duration" type="xs:duration"/>
63 </xs:attributeGroup>
64 <!-- Begin properties for the Metrics capability -->
65 <xs:element name="CurrentTime" type="xs:dateTime"/>
66 <!-- End properties for the Metrics capability -->
67 <xs:complexType name="RelationshipTypeType">
68 <xs:complexContent>
69 <xs:extension base="muws2:CategoryType"/>
70 </xs:complexContent>
71 </xs:complexType>
72 <xs:element name="Self">
73 <xs:complexType/>
74 </xs:element>
75 <xs:complexType name="RelationshipParticipantType">
76 <xs:sequence>
77 <xs:element ref="muws2:Self" minOccurs="0"/>
78 <xs:element ref="muws1:ManageabilityEndpointReference" minOccurs="0" maxOccurs="unbounded"/>
79 <xs:element ref="wsa:EndpointReference" minOccurs="0" maxOccurs="unbounded"/>
80 <xs:element ref="muws1:ResourceId" minOccurs="0"/>
81 <xs:element name="Role" type="xs:anyURI"/>
82 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
83 </xs:sequence>
84 <xs:anyAttribute namespace="##other"/>
85 </xs:complexType>
86 <!-- Begin properties for the RelationshipResource capability -->
87 <xs:element name="Name" type="xs:string"/>
88 <xs:element name="Type" type="muws2:RelationshipTypeType"/>
89 <xs:element name="Participant" type="muws2:RelationshipParticipantType"/>
90 <!-- End properties for the RelationshipResource capability -->
91 <xs:complexType name="RelationshipType">
92 <xs:sequence>
93 <xs:element ref="muws2:Name" minOccurs="0"/>
94 <xs:element ref="muws2:Type"/>
95 <xs:element ref="muws2:Participant" minOccurs="2" maxOccurs="unbounded"/>
96 <xs:element name="AccessEndpointReference" type="wsa:EndpointReferenceType" minOccurs="0"/>
97 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
98 </xs:sequence>
99 <xs:anyAttribute namespace="##other"/>
100 </xs:complexType>
101 <!-- Begin properties for the Relationship capability -->
102 <xs:element name="Relationship" type="muws2:RelationshipType"/>
103 <!-- End properties for the Relationship capability -->
104 <xs:element name="RelationshipCreatedNotification">
105 <xs:complexType>
106 <xs:sequence>
107 <xs:element ref="muws2:Relationship"/>
108 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
109 </xs:sequence>
110 <xs:anyAttribute namespace="##other"/>
111 </xs:complexType>
112 </xs:element>
113 <xs:element name="RelationshipDeletedNotification">
114 <xs:complexType>
115 <xs:sequence>
116 <xs:element ref="muws2:Relationship"/>
117 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
118 </xs:sequence>
119 <xs:anyAttribute namespace="##other"/>
120 </xs:complexType>
121 </xs:element>
122 <xs:element name="QueryRelationshipsByType">
123 <xs:complexType>
124 <xs:sequence>
125 <xs:element name="RequestedType" type="xs:QName"/>
126 </xs:sequence>
127 </xs:complexType>
128 </xs:element>
129 <xs:element name="QueryRelationshipsByTypeResponse">
130 <xs:complexType>
131 <xs:sequence>
132 <xs:element ref="muws2:Relationship" minOccurs="0" maxOccurs="unbounded"/>
133 </xs:sequence>
134 </xs:complexType>
135 </xs:element>
136 <xs:element name="CreationNotification">
137 <xs:complexType>
138 <xs:sequence>
139 <xs:element ref="muws1:ManageabilityEndpointReference" minOccurs="0" maxOccurs="unbounded"/>
140 </xs:sequence>
141 <xs:anyAttribute namespace="##other"/>
142 </xs:complexType>
143 </xs:element>
144 <xs:element name="DestructionNotification">
145 <xs:complexType>
146 <xs:sequence>
147 <xs:element ref="muws1:ResourceId" minOccurs="0"/>
148 </xs:sequence>
149 <xs:anyAttribute namespace="##other"/>
150 </xs:complexType>
151 </xs:element>
152 <xs:complexType name="SituationCategoryType">
153 <xs:complexContent>
154 <xs:extension base="muws2:CategoryType">
155 <xs:sequence>
156 <xs:element name="SituationName" minOccurs="0"/>
157 </xs:sequence>
158 </xs:extension>
159 </xs:complexContent>
160 </xs:complexType>
161 <xs:element name="fred" type="xs:string"/>
162 <xs:complexType name="SubstitutableMsgType">
163 <xs:sequence>
164 <xs:element name="Value" type="xs:anySimpleType" minOccurs="0" maxOccurs="unbounded"/>
165 </xs:sequence>
166 <xs:attribute name="MsgId" type="xs:string" use="required"/>
167 <xs:attribute name="MsgIdType" type="xs:anyURI" use="required"/>
168 </xs:complexType>
169 <xs:complexType name="SituationType">
170 <xs:sequence>
171 <xs:element name="SituationCategory" type="muws2:SituationCategoryType"/>
172 <xs:element name="SuccessDisposition" minOccurs="0">
173 <xs:simpleType>
174 <xs:restriction base="xs:string">
175 <xs:enumeration value="Successful"/>
176 <xs:enumeration value="Unsuccessful"/>
177 </xs:restriction>
178 </xs:simpleType>
179 </xs:element>
180 <xs:element name="SituationTime" type="xs:dateTime"/>
181 <xs:element name="Priority" type="xs:short" minOccurs="0"/>
182 <xs:element name="Severity" type="xs:short" minOccurs="0"/>
183 <xs:element name="Message" type="muws2:LangString" minOccurs="0"/>
184 <xs:element name="SubstitutableMsg" type="muws2:SubstitutableMsgType" minOccurs="0"/>
185 </xs:sequence>
186 </xs:complexType>
187 <xs:element name="Situation" type="muws2:SituationType"/>
188 <xs:complexType name="EventCorrelationPropertiesType">
189 <xs:sequence>
190 <xs:element name="repeatCount" minOccurs="0">
191 <xs:simpleType>
192 <xs:restriction base="xs:short">
193 <xs:minInclusive value="0"/>
194 </xs:restriction>
195 </xs:simpleType>
196 </xs:element>
197 <xs:element name="elapsedTime" minOccurs="0">
198 <xs:simpleType>
199 <xs:restriction base="xs:long">
200 <xs:minInclusive value="0"/>
201 </xs:restriction>
202 </xs:simpleType>
203 </xs:element>
204 </xs:sequence>
205 <xs:attribute name="sequenceNumber" type="xs:unsignedLong"/>
206 </xs:complexType>
207 <xs:element name="EventCorrelationProperties" type="muws2:EventCorrelationPropertiesType"/>
208 <xs:complexType name="MsgCatalogInformationType">
209 <xs:sequence>
210 <xs:element name="msgCatalog" type="xs:anyURI"/>
211 <xs:element name="msgCatalogType" type="xs:anyURI" minOccurs="0"/>
212 </xs:sequence>
213 </xs:complexType>
214 <xs:element name="MsgCatalogInformation" type="muws2:MsgCatalogInformationType"/>
215 <!-- ##### Metadata description elements ##### -->
216 <xs:element name="Capability" type="xs:anyURI"/>
217 <xs:complexType name="DialectableExpressionType" mixed="true">
218 <xs:sequence>
219 <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
220 </xs:sequence>
221 <xs:attribute name="Dialect" type="xs:anyURI" use="required"/>
222 <xs:anyAttribute namespace="##other"/>
223 </xs:complexType>
224 <xs:element name="ValidWhile" type="muws2:DialectableExpressionType"/>
225 <xs:element name="Units" type="xs:string"/>
226 <xs:element name="ChangeType">
227 <xs:simpleType>
228 <xs:restriction base="xs:string">
229 <xs:enumeration value="Counter"/>
230 <xs:enumeration value="Gauge"/>
231 <xs:enumeration value="Unknown"/>
232 </xs:restriction>
233 </xs:simpleType>
234 </xs:element>
235 <xs:element name="TimeScope">
236 <xs:simpleType>
237 <xs:restriction base="xs:string">
238 <xs:enumeration value="Interval"/>
239 <xs:enumeration value="PointInTime"/>
240 <xs:enumeration value="SinceReset"/>
241 </xs:restriction>
242 </xs:simpleType>
243 </xs:element>
244 <xs:element name="GatheringTime">
245 <xs:simpleType>
246 <xs:restriction base="xs:string">
247 <xs:enumeration value="OnChange"/>
248 <xs:enumeration value="Periodic"/>
249 <xs:enumeration value="OnDemand"/>
250 <xs:enumeration value="Unknown"/>
251 </xs:restriction>
252 </xs:simpleType>
253 </xs:element>
254 <xs:element name="CalculationInterval" type="xs:duration"/>
255 <xs:element name="MetricGroup" type="xs:anyURI"/>
256 <xs:element name="PostCondition" type="muws2:DialectableExpressionType"/>
257 <!-- ========= StartSituation ============ -->
258 <xs:element name="StartSituation">
259 <xs:complexType>
260 <xs:complexContent>
261 <xs:restriction base="muws2:SituationCategoryType"/>
262 </xs:complexContent>
263 </xs:complexType>
264 </xs:element>
265 <xs:element name="StartInitiated">
266 <xs:complexType>
267 <xs:complexContent>
268 <xs:restriction base="muws2:SituationCategoryType">
269 <xs:sequence>
270 <xs:element ref="muws2:StartSituation"/>
271 </xs:sequence>
272 </xs:restriction>
273 </xs:complexContent>
274 </xs:complexType>
275 </xs:element>
276 <xs:element name="RestartInitiated">
277 <xs:complexType>
278 <xs:complexContent>
279 <xs:restriction base="muws2:SituationCategoryType">
280 <xs:sequence>
281 <xs:element ref="muws2:StartSituation"/>
282 </xs:sequence>
283 </xs:restriction>
284 </xs:complexContent>
285 </xs:complexType>
286 </xs:element>
287 <xs:element name="StartCompleted">
288 <xs:complexType>
289 <xs:complexContent>
290 <xs:restriction base="muws2:SituationCategoryType">
291 <xs:sequence>
292 <xs:element ref="muws2:StartSituation"/>
293 </xs:sequence>
294 </xs:restriction>
295 </xs:complexContent>
296 </xs:complexType>
297 </xs:element>
298 <!-- ========= StopSituation ============ -->
299 <xs:element name="StopSituation">
300 <xs:complexType>
301 <xs:complexContent>
302 <xs:restriction base="muws2:SituationCategoryType"/>
303 </xs:complexContent>
304 </xs:complexType>
305 </xs:element>
306 <xs:element name="StopInitiated">
307 <xs:complexType>
308 <xs:complexContent>
309 <xs:restriction base="muws2:SituationCategoryType">
310 <xs:sequence>
311 <xs:element ref="muws2:StopSituation"/>
312 </xs:sequence>
313 </xs:restriction>
314 </xs:complexContent>
315 </xs:complexType>
316 </xs:element>
317 <xs:element name="AbortInitiated">
318 <xs:complexType>
319 <xs:complexContent>
320 <xs:restriction base="muws2:SituationCategoryType">
321 <xs:sequence>
322 <xs:element ref="muws2:StopSituation"/>
323 </xs:sequence>
324 </xs:restriction>
325 </xs:complexContent>
326 </xs:complexType>
327 </xs:element>
328 <xs:element name="PauseInitiated">
329 <xs:complexType>
330 <xs:complexContent>
331 <xs:restriction base="muws2:SituationCategoryType">
332 <xs:sequence>
333 <xs:element ref="muws2:StopSituation"/>
334 </xs:sequence>
335 </xs:restriction>
336 </xs:complexContent>
337 </xs:complexType>
338 </xs:element>
339 <xs:element name="StopCompleted">
340 <xs:complexType>
341 <xs:complexContent>
342 <xs:restriction base="muws2:SituationCategoryType">
343 <xs:sequence>
344 <xs:element ref="muws2:StopSituation"/>
345 </xs:sequence>
346 </xs:restriction>
347 </xs:complexContent>
348 </xs:complexType>
349 </xs:element>
350 <!-- ========= RequestSituation ============ -->
351 <xs:element name="RequestSituation">
352 <xs:complexType>
353 <xs:complexContent>
354 <xs:restriction base="muws2:SituationCategoryType"/>
355 </xs:complexContent>
356 </xs:complexType>
357 </xs:element>
358 <xs:element name="RequestInitiated">
359 <xs:complexType>
360 <xs:complexContent>
361 <xs:restriction base="muws2:SituationCategoryType">
362 <xs:sequence>
363 <xs:element ref="muws2:RequestSituation"/>
364 </xs:sequence>
365 </xs:restriction>
366 </xs:complexContent>
367 </xs:complexType>
368 </xs:element>
369 <xs:element name="RequestCompleted">
370 <xs:complexType>
371 <xs:complexContent>
372 <xs:restriction base="muws2:SituationCategoryType">
373 <xs:sequence>
374 <xs:element ref="muws2:RequestSituation"/>
375 </xs:sequence>
376 </xs:restriction>
377 </xs:complexContent>
378 </xs:complexType>
379 </xs:element>
380 <!-- ========= DestroySituation ============ -->
381 <xs:element name="DestroySituation">
382 <xs:complexType>
383 <xs:complexContent>
384 <xs:restriction base="muws2:SituationCategoryType"/>
385 </xs:complexContent>
386 </xs:complexType>
387 </xs:element>
388 <xs:element name="DestroyInitiated">
389 <xs:complexType>
390 <xs:complexContent>
391 <xs:restriction base="muws2:SituationCategoryType">
392 <xs:sequence>
393 <xs:element ref="muws2:DestroySituation"/>
394 </xs:sequence>
395 </xs:restriction>
396 </xs:complexContent>
397 </xs:complexType>
398 </xs:element>
399 <xs:element name="DestroyCompleted">
400 <xs:complexType>
401 <xs:complexContent>
402 <xs:restriction base="muws2:SituationCategoryType">
403 <xs:sequence>
404 <xs:element ref="muws2:DestroySituation"/>
405 </xs:sequence>
406 </xs:restriction>
407 </xs:complexContent>
408 </xs:complexType>
409 </xs:element>
410 <!-- ========= CreateSituation ============ -->
411 <xs:element name="CreateSituation">
412 <xs:complexType>
413 <xs:complexContent>
414 <xs:restriction base="muws2:SituationCategoryType"/>
415 </xs:complexContent>
416 </xs:complexType>
417 </xs:element>
418 <xs:element name="CreateInitiated">
419 <xs:complexType>
420 <xs:complexContent>
421 <xs:restriction base="muws2:SituationCategoryType">
422 <xs:sequence>
423 <xs:element ref="muws2:CreateSituation"/>
424 </xs:sequence>
425 </xs:restriction>
426 </xs:complexContent>
427 </xs:complexType>
428 </xs:element>
429 <xs:element name="CreateCompleted">
430 <xs:complexType>
431 <xs:complexContent>
432 <xs:restriction base="muws2:SituationCategoryType">
433 <xs:sequence>
434 <xs:element ref="muws2:CreateSituation"/>
435 </xs:sequence>
436 </xs:restriction>
437 </xs:complexContent>
438 </xs:complexType>
439 </xs:element>
440 <!-- ========= ConnectSituation ============ -->
441 <xs:element name="ConnectSituation">
442 <xs:complexType>
443 <xs:complexContent>
444 <xs:restriction base="muws2:SituationCategoryType"/>
445 </xs:complexContent>
446 </xs:complexType>
447 </xs:element>
448 <xs:element name="ConnectInitiated">
449 <xs:complexType>
450 <xs:complexContent>
451 <xs:restriction base="muws2:SituationCategoryType">
452 <xs:sequence>
453 <xs:element ref="muws2:ConnectSituation"/>
454 </xs:sequence>
455 </xs:restriction>
456 </xs:complexContent>
457 </xs:complexType>
458 </xs:element>
459 <xs:element name="ReconnectInitiated">
460 <xs:complexType>
461 <xs:complexContent>
462 <xs:restriction base="muws2:SituationCategoryType">
463 <xs:sequence>
464 <xs:element ref="muws2:ConnectSituation"/>
465 </xs:sequence>
466 </xs:restriction>
467 </xs:complexContent>
468 </xs:complexType>
469 </xs:element>
470 <xs:element name="ConnectCompleted">
471 <xs:complexType>
472 <xs:complexContent>
473 <xs:restriction base="muws2:SituationCategoryType">
474 <xs:sequence>
475 <xs:element ref="muws2:ConnectSituation"/>
476 </xs:sequence>
477 </xs:restriction>
478 </xs:complexContent>
479 </xs:complexType>
480 </xs:element>
481 <!-- ========= ReportSituation ============ -->
482 <xs:element name="ReportSituation">
483 <xs:complexType>
484 <xs:complexContent>
485 <xs:restriction base="muws2:SituationCategoryType"/>
486 </xs:complexContent>
487 </xs:complexType>
488 </xs:element>
489 <xs:element name="PerformanceReport">
490 <xs:complexType>
491 <xs:complexContent>
492 <xs:restriction base="muws2:SituationCategoryType">
493 <xs:sequence>
494 <xs:element ref="muws2:ReportSituation"/>
495 </xs:sequence>
496 </xs:restriction>
497 </xs:complexContent>
498 </xs:complexType>
499 </xs:element>
500 <xs:element name="SecurityReport">
501 <xs:complexType>
502 <xs:complexContent>
503 <xs:restriction base="muws2:SituationCategoryType">
504 <xs:sequence>
505 <xs:element ref="muws2:ReportSituation"/>
506 </xs:sequence>
507 </xs:restriction>
508 </xs:complexContent>
509 </xs:complexType>
510 </xs:element>
511 <xs:element name="HeartbeatReport">
512 <xs:complexType>
513 <xs:complexContent>
514 <xs:restriction base="muws2:SituationCategoryType">
515 <xs:sequence>
516 <xs:element ref="muws2:ReportSituation"/>
517 </xs:sequence>
518 </xs:restriction>
519 </xs:complexContent>
520 </xs:complexType>
521 </xs:element>
522 <xs:element name="StatusReport">
523 <xs:complexType>
524 <xs:complexContent>
525 <xs:restriction base="muws2:SituationCategoryType">
526 <xs:sequence>
527 <xs:element ref="muws2:ReportSituation"/>
528 </xs:sequence>
529 </xs:restriction>
530 </xs:complexContent>
531 </xs:complexType>
532 </xs:element>
533 <xs:element name="TraceReport">
534 <xs:complexType>
535 <xs:complexContent>
536 <xs:restriction base="muws2:SituationCategoryType"&g -
Error while Registering XML Schema
Hi Team,
The mail purpose of my project is to load data from XML feed file into Oracle tables. I did following steps which went perfectly fine ...
I did following steps.
1)create DIRECTORY xml_dir as 'c:\xmldata';
2) create table xmltab of XMLType;
3) Following packages are executed through "Sys" Schema
1)dbmslob.sql;
2)prvtlob.plb;
4) An xmldata folder is created under "c:\" and file with data_file.xml is stored in it.
5) insert into xmltab values(XMLType(bfilename('XML_DIR ','data_file.xml'), nls_charset_id('AL32UTF8')));
When I try to execute following select statment "No Rows Selected" message is displayed; although there is one element in xml data file.
SELECT OBJECT_VALUE
FROM xmltab
WHERE existsNode(OBJECT_VALUE, '/ConsolidatedAssetHeader[AssetSourceSystem= "CAPS"]')=1
Now I think in order to use all functions like existsNode and exctractValue I will have to register Schema in DB.
Following is the XML Schema file.
<xsd:schema targetNamespace="schemas-dart-com:sql:ConsolidatedAssetHeader" xmlns:schema="schemas-dart-com:sql:ConsolidatedAssetHeader" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified">
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" />
- <xsd:element name="ConsolidatedAssetHeader">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="InternalId" type="sqltypes:int" />
- <xsd:element name="DCN">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="30" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="EventDateLastChanged" type="sqltypes:datetime" minOccurs="0" />
- <xsd:element name="FinancialStatusIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="InScopeIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationPriorityIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="PhysicalInstallDate" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetComment" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetContractExtension" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetContractNumber" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetDescription" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetFinancialInstallDate" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="AssetFinancialRemovalDate" type="sqltypes:datetime" minOccurs="0" />
- <xsd:element name="AssetFinancialStatus" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetName" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetParentSource" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetParentSourceID" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetPhysicalInstallDate" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="AssetPhysicalRemovalDate" type="sqltypes:datetime" minOccurs="0" />
- <xsd:element name="AssetPhysicalStatus" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetPhysicalStatusIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSerialIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSerialNumber" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSource" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceID" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceSystem" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceType" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetTag" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="BillabilityIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="InScopeFlag" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="IPAddress" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="NetworkNumber" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="SubnetAddress" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element ref="schema:ConsolidatedAssetLocation" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
+ <xsd:element name="ConsolidatedAssetLocation">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="InternalId" type="sqltypes:int" minOccurs="0" />
<xsd:element name="ParentId" type="sqltypes:int" minOccurs="0" />
- <xsd:element name="AssetLocationIDBillTo" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetLocationIDShipTo" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetLocationIDSoldTo" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceDt" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceIDDt" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="AssetSourceSystemDt" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="ContractNumberExtensionDt" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToAddress" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToAddressLine2" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToAddressLine3" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToCity" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToCountry" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToAddressLine4" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToState" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationBillToZip" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationPriorityIndicator" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToAddress" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToAddressLine2" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToAddressLine3" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToAddressLine4" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToCity" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToCountry" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToState" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationShipToZip" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToAddress" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToAddressLine2" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToAddressLine3" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToAddressLine4" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToCity" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToCountry" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToState" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="LocationSoldToZip" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="PartySource" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="PartySourceID" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RowCreateDateTime" type="sqltypes:datetime" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
I use following package to register schema, which is giving error
BEGIN
DBMS_XMLSCHEMA.registerSchema(
'schemas-dart-com:sql:ConsolidatedAssetHeader',
XDBURIType('http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd').getClob(),
TRUE,
TRUE,
FALSE,
TRUE);
END;
Following Error is displayed.
BEGIN
ERROR at line 1:
ORA-31001: Invalid resource handle or path name
"http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd"
ORA-06512: at "SYS.XDBURITYPE", line 4
ORA-06512: at line 2
Can you please tell me what changes I need to make in order to resolve this error?Is there any specific location where I should put my schema file?
Thanks in Advance
VaibhaviCreate a file in c:\xmldata with the name my_xmlschema.xsd with the following content
<xsd:schema targetNamespace="schemas-dart-com:sql:ConsolidatedAssetHeader" xmlns:schema="schemas-dart-com:sql:ConsolidatedAssetHeader" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified">
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" />
<xsd:element name="ConsolidatedAssetHeader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InternalId" type="sqltypes:int" />
<xsd:element name="DCN">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="30" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="EventDateLastChanged" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="FinancialStatusIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="InScopeIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationPriorityIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PhysicalInstallDate" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetComment" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetContractExtension" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetContractNumber" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetDescription" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetFinancialInstallDate" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="AssetFinancialRemovalDate" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="AssetFinancialStatus" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetName" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="255" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetParentSource" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetParentSourceID" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetPhysicalInstallDate" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="AssetPhysicalRemovalDate" type="sqltypes:datetime" minOccurs="0" />
<xsd:element name="AssetPhysicalStatus" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetPhysicalStatusIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSerialIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSerialNumber" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSource" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceID" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceSystem" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceType" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetTag" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BillabilityIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="InScopeFlag" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="IPAddress" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NetworkNumber" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="SubnetAddress" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element ref="schema:ConsolidatedAssetLocation" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
+ <xsd:element name="ConsolidatedAssetLocation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InternalId" type="sqltypes:int" minOccurs="0" />
<xsd:element name="ParentId" type="sqltypes:int" minOccurs="0" />
<xsd:element name="AssetLocationIDBillTo" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetLocationIDShipTo" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetLocationIDSoldTo" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceDt" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceIDDt" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AssetSourceSystemDt" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ContractNumberExtensionDt" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToAddress" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToAddressLine2" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToAddressLine3" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToCity" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToCountry" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToAddressLine4" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToState" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationBillToZip" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationPriorityIndicator" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToAddress" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToAddressLine2" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToAddressLine3" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToAddressLine4" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToCity" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToCountry" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToState" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationShipToZip" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToAddress" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToAddressLine2" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToAddressLine3" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToAddressLine4" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="150" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToCity" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToCountry" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToState" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LocationSoldToZip" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PartySource" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PartySourceID" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RowCreateDateTime" type="sqltypes:datetime" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> -
Hi all,
I just got a copy of the book "Pro SQL Server 2008 XML" written by Michael Coles (published by Apress) and try to learn the XML Schema Collection in my SQL Server 2012 Management Studio (SSMS2012). I studied Chapter 4 XML Collection of the book
and executed the following code of Listing 4-8 Complex Schema with Attribute:
-- Pro SQL Server 2008 XML by Michael Coles (Apress)
-- Listing04-08.sql Complex XML Schema with Attribute
-- shcColes04-08.sql saved in C:\\Documents\XML_SQL_Server2008_code_Coles_Apress
-- 6 April 2015 8:00 PM
CREATE XML SCHEMA COLLECTION dbo.ComplexTestSchemaCollection_attribute
AS
N'<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element name="name" />
<xs:element name="color" />
<xs:group ref="id-price" />
<xs:group ref="size-group" />
</xs:sequence>
<xs:attribute name="id" />
<xs:attribute name="number" />
</xs:complexType>
</xs:element>
<xs:group name="id-price">
<xs:choice>
<xs:element name="list-price" />
<xs:element name="standard-cost" />
</xs:choice>
</xs:group>
<xs:group name="size-group">
<xs:sequence>
<xs:element name="size" />
<xs:element name="unit-of-measure" />
</xs:sequence>
</xs:group>
</xs:schema>';
GO
DECLARE @x XML (dbo.ComplexTestSchemaCollection_attribute);
SET @x = N'<?xml version="1.0"?>
<item id="749" number="BK-R93R-62">
<name>Road-150 Red, 62</name>
<color>Red</color>
<list-price>3578.27</list-price>
<size>62</size>
<unit-of-measure>CM</unit-of-measure>
</item>';
SELECT @x;
GO
DROP XML SCHEMA COLLECTION dbo.ComplexTestSchemaCollection_attribute;
It worked nicely. But, I just found out the coding that was downloaded from the website of Apress and I just executed was different from the coding of Listing 4-8 listed in the book: all the <xs: ....> and </xs: ..> in my SSMS2012 are
listed as <xsd:...> and </xsd:...> respectively in the book!!?? The same thing happens in the Listing 4-3 Simple XML Schema, Listing 4-5 XML Schema and Valid XML Document with Comple Type Definition, Listion 4-6 XML Schema and XML
Document Document with Complex Type Using <sequence> and <choice>, and Listing 4-7 Complex XML Schema and XML Document with Model Group Definition (I executed last week) too. I wonder: should xs or xsd be used in the XML
Schema Collection of SSMS2012? Please kindly help, clarify this matter and explain the diffirence of using xs and xsd for me.
Thanks in advance,
Scott ChangHi Scott,
Using xs or xsd depends on how you declare the namespace prefix.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="item">
I've posted a very good link in your last question, just in case you might have missed it, please see the below link.
Understanding XML Namespaces
In an XML document we use a namespace prefix to qualify the local names of both elements and attributes . A prefix is really just an abbreviation for the namespace identifier (URI), which is typically quite long. The prefix is first mapped to a namespace
identifier through a namespace declaration. The syntax for a namespace declaration is:
xmlns:<prefix>='<namespace identifier>'
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
How to create XML from relational tables based on an XML Schema ?
There is no automated way in Oracle XML DB to define an automatic mapping between a set of columns in some existing relational tables and the elements and attributres defined by an XML Schema.
However it is easy solve this problem by using the SQL/XML operators (XMLAGG, XMLELEMENT, XMLFOREST, XMLATTRIBUTES, etc) to generate XML documents that are compliant with an XML Schema directly from a SQL statement.
If the XML Schema is registered with Oracle XML DB and the appropraite Schema Location information is added into the generated document using XMLAttributes then it becomes very easy to ensure that the generated documents are valid.
The following example show an easy way to do this by creating an XML View that contains the documents to be validated.
SQL> drop table PURCHASEORDER_LINEITEM
2 /
Table dropped.
SQL> drop table PURCHASEORDER_REJECTION
2 /
Table dropped.
SQL> drop table PURCHASEORDER_SHIPPING
2 /
Table dropped.
SQL> drop TABLE PURCHASEORDER_ACTION
2 /
Table dropped.
SQL> drop TABLE PURCHASEORDER_TABLE
2 /
Table dropped.
SQL> create table PURCHASEORDER_TABLE
2 (
3 REFERENCE VARCHAR2(28),
4 PRIMARY KEY ("REFERENCE"),
5 REQUESTER VARCHAR2(48),
6 USERID VARCHAR2(32),
7 COSTCENTER VARCHAR2(3),
8 SPECIALINSTRUCTIONS VARCHAR2(2048)
9 )
10 /
Table created.
SQL> create table PURCHASEORDER_ACTION
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 ACTIONEDBY VARCHAR2(32),
6 DATEACTIONED DATE
7 )
8 /
Table created.
SQL> create table PURCHASEORDER_SHIPPING
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 PRIMARY KEY ("REFERENCE"),
6 SHIPTONAME VARCHAR2(48),
7 ADDRESS VARCHAR2(512),
8 PHONE VARCHAR2(32)
9 )
10 /
Table created.
SQL> create table PURCHASEORDER_REJECTION
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 PRIMARY KEY ("REFERENCE"),
6 REJECTEDBY VARCHAR2(32),
7 DATEREJECTED DATE,
8 COMMENTS VARCHAR2(2048)
9 )
10 /
Table created.
SQL> create table PURCHASEORDER_LINEITEM
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 LINENO NUMBER(10),
6 PRIMARY KEY ("REFERENCE","LINENO"),
7 UPC VARCHAR2(14),
8 DESCRIPTION VARCHAR2(128),
9 QUANTITY NUMBER(10),
10 UNITPRICE NUMBER(12,2)
11 )
12 /
Table created.
SQL> insert into PURCHASEORDER_TABLE values ('SMCCAIN-20030109123335470PDT','Samuel B. McCain','SMCCAIN','A10','Courier')
2 /
1 row created.
SQL> insert into PURCHASEORDER_ACTION values ('SMCCAIN-20030109123335470PDT','SVOLLMAN',NULL)
2 /
1 row created.
SQL> insert into PURCHASEORDER_SHIPPING values ('SMCCAIN-20030109123335470PDT','Samuel B. McCain','800 Bridge Parkway,Redwood Shores,CA,9406
5,USA','650 506 7800')
2 /
1 row created.
SQL> insert into PURCHASEORDER_REJECTION values ('SMCCAIN-20030109123335470PDT',null,null,null)
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','1','715515010320','Life of Brian - Monty Python''s','2','39.
95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','2','37429145227','The Night Porter','2','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','3','37429128121','Oliver Twist','1','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','4','715515012720','Notorious','4','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','5','715515012928','In the Mood for Love','3','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','6','37429130926','Alphaville','2','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','7','37429166529','General Idi Amin Dada','4','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','8','715515012928','In the Mood for Love','3','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','9','715515009423','Flesh for Frankenstein','3','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','10','715515008976','The Killer','1','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','11','37429167922','Ballad of a Soldier','2','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','12','37429158623','Ordet','2','0')
2 /
1 row created.
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd';
3 :schemaPath := '/public/purchaseOrder.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="tr
ue">
6 <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
7 <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T" xdb:maintainDOM="false">
8 <xs:sequence>
9 <xs:element name="Reference" type="ReferenceType" xdb:SQLName="REFERENCE"/>
10 <xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
11 <xs:element name="Reject" type="RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
12 <xs:element name="Requestor" type="RequestorType" xdb:SQLName="REQUESTOR"/>
13 <xs:element name="User" type="UserType" xdb:SQLName="USERID"/>
14 <xs:element name="CostCenter" type="CostCenterType" xdb:SQLName="COST_CENTER"/>
15 <xs:element name="ShippingInstructions" type="ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
16 <xs:element name="SpecialInstructions" type="SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
17 <xs:element name="LineItems" type="LineItemsType" xdb:SQLName="LINEITEMS"/>
18 </xs:sequence>
19 </xs:complexType>
20 <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T" xdb:maintainDOM="false">
21 <xs:sequence>
22 <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="L
INEITEM_V"/>
23 </xs:sequence>
24 </xs:complexType>
25 <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T" xdb:maintainDOM="false">
26 <xs:sequence>
27 <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESRIPTION"/>
28 <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
29 </xs:sequence>
30 <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
31 </xs:complexType>
32 <xs:complexType name="PartType" xdb:SQLType="PART_T" xdb:maintainDOM="false">
33 <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
34 <xs:simpleType>
35 <xs:restriction base="xs:string">
36 <xs:minLength value="10"/>
37 <xs:maxLength value="14"/>
38 </xs:restriction>
39 </xs:simpleType>
40 </xs:attribute>
41 <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
42 <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
43 </xs:complexType>
44 <xs:simpleType name="ReferenceType">
45 <xs:restriction base="xs:string">
46 <xs:minLength value="18"/>
47 <xs:maxLength value="30"/>
48 </xs:restriction>
49 </xs:simpleType>
50 <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T" xdb:maintainDOM="false">
51 <xs:sequence>
52 <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
53 <xs:complexType xdb:SQLType="ACTION_T" xdb:maintainDOM="false">
54 <xs:sequence>
55 <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
56 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
57 </xs:sequence>
58 </xs:complexType>
59 </xs:element>
60 </xs:sequence>
61 </xs:complexType>
62 <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T" xdb:maintainDOM="false">
63 <xs:all>
64 <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
65 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
66 <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
67 </xs:all>
68 </xs:complexType>
69 <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T" xdb:maintainDOM="false">
70 <xs:sequence>
71 <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
72 <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
73 <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
74 </xs:sequence>
75 </xs:complexType>
76 <xs:simpleType name="moneyType">
77 <xs:restriction base="xs:decimal">
78 <xs:fractionDigits value="2"/>
79 <xs:totalDigits value="12"/>
80 </xs:restriction>
81 </xs:simpleType>
82 <xs:simpleType name="quantityType">
83 <xs:restriction base="xs:decimal">
84 <xs:fractionDigits value="4"/>
85 <xs:totalDigits value="8"/>
86 </xs:restriction>
87 </xs:simpleType>
88 <xs:simpleType name="UserType">
89 <xs:restriction base="xs:string">
90 <xs:minLength value="1"/>
91 <xs:maxLength value="10"/>
92 </xs:restriction>
93 </xs:simpleType>
94 <xs:simpleType name="RequestorType">
95 <xs:restriction base="xs:string">
96 <xs:minLength value="0"/>
97 <xs:maxLength value="128"/>
98 </xs:restriction>
99 </xs:simpleType>
100 <xs:simpleType name="CostCenterType">
101 <xs:restriction base="xs:string">
102 <xs:minLength value="1"/>
103 <xs:maxLength value="4"/>
104 </xs:restriction>
105 </xs:simpleType>
106 <xs:simpleType name="VendorType">
107 <xs:restriction base="xs:string">
108 <xs:minLength value="0"/>
109 <xs:maxLength value="20"/>
110 </xs:restriction>
111 </xs:simpleType>
112 <xs:simpleType name="PurchaseOrderNumberType">
113 <xs:restriction base="xs:integer"/>
114 </xs:simpleType>
115 <xs:simpleType name="SpecialInstructionsType">
116 <xs:restriction base="xs:string">
117 <xs:minLength value="0"/>
118 <xs:maxLength value="2048"/>
119 </xs:restriction>
120 </xs:simpleType>
121 <xs:simpleType name="NameType">
122 <xs:restriction base="xs:string">
123 <xs:minLength value="1"/>
124 <xs:maxLength value="20"/>
125 </xs:restriction>
126 </xs:simpleType>
127 <xs:simpleType name="AddressType">
128 <xs:restriction base="xs:string">
129 <xs:minLength value="1"/>
130 <xs:maxLength value="256"/>
131 </xs:restriction>
132 </xs:simpleType>
133 <xs:simpleType name="TelephoneType">
134 <xs:restriction base="xs:string">
135 <xs:minLength value="1"/>
136 <xs:maxLength value="24"/>
137 </xs:restriction>
138 </xs:simpleType>
139 <xs:simpleType name="DateType">
140 <xs:restriction base="xs:date"/>
141 </xs:simpleType>
142 <xs:simpleType name="CommentsType">
143 <xs:restriction base="xs:string">
144 <xs:minLength value="1"/>
145 <xs:maxLength value="2048"/>
146 </xs:restriction>
147 </xs:simpleType>
148 <xs:simpleType name="DescriptionType">
149 <xs:restriction base="xs:string">
150 <xs:minLength value="1"/>
151 <xs:maxLength value="256"/>
152 </xs:restriction>
153 </xs:simpleType>
154 </xs:schema>
155 ');
156 begin
157 if (dbms_xdb.existsResource(:schemaPath)) then
158 dbms_xdb.deleteResource(:schemaPath);
159 end if;
160 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
161 end;
162 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,FALSE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> create or replace view PURCHASEORDER_XML
2 of xmltype
3 xmlSCHEMA "http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" Element "PurchaseOrder"
4 with object id
5 (
6 substr(extractValue(object_value,'/PurchaseOrder/Reference'),1,32)
7 )
8 as
9 select xmlElement
10 (
11 "PurchaseOrder",
12 xmlAttributes
13 (
14 'http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd' as "xsi:noNamespaceSchemaLocation",
15 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi"
16 ),
17 xmlElement("Reference",p.REFERENCE),
18 xmlElement
19 (
20 "Actions",
21 ( select xmlAgg
22 (
23 xmlElement
24 (
25 "Action",
26 xmlElement("User",ACTIONEDBY),
27 case
28 when DATEACTIONED is not null
29 then xmlElement("Date",DATEACTIONED)
30 end
31 )
32 )
33 from PURCHASEORDER_ACTION a
34 where a.REFERENCE = p.REFERENCE
35 )
36 ),
37 xmlElement
38 (
39 "Reject",
40 xmlForest
41 (
42 REJECTEDBY as "User",
43 DATEREJECTED as "Date",
44 COMMENTS as "Comments"
45 )
46 ),
47 xmlElement("Requestor",REQUESTER),
48 xmlElement("User",USERID),
49 xmlElement("CostCenter",COSTCENTER),
50 xmlElement
51 (
52 "ShippingInstructions",
53 xmlElement("name",SHIPTONAME),
54 xmlElement("address",ADDRESS),
55 xmlElement("telephone",PHONE)
56 ),
57 xmlElement("SpecialInstructions",SPECIALINSTRUCTIONS),
58 xmlElement
59 (
60 "LineItems",
61 ( select xmlAgg
62 (
63 xmlElement
64 (
65 "LineItem",
66 xmlAttributes(LINENO as "ItemNumber"),
67 xmlElement("Description",DESCRIPTION),
68 xmlElement
69 (
70 "Part",
71 xmlAttributes
72 (
73 UPC as "Id",
74 QUANTITY as "Quantity",
75 UNITPRICE as "UnitPrice"
76 )
77 )
78 )
79 )
80 from PURCHASEORDER_LINEITEM l
81 where l.REFERENCE = p.REFERENCE
82 )
83 )
84 )
85 from PURCHASEORDER_TABLE p, PURCHASEORDER_REJECTION r, PURCHASEORDER_SHIPPING s
86 where r.REFERENCE = p.REFERENCE
87 and s.REFERENCE = p.REFERENCE
88 /
View created.
SQL> set long 10000 pages 0 lines 140
SQL> --
SQL> select x.object_value.extract('/*')
2 from PURCHASEORDER_XML x
3 /
<PurchaseOrder xsi:noNamespaceSchemaLocation="http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Reference>SMCCAIN-20030109123335470PDT</Reference>
<Actions>
<Action>
<User>SVOLLMAN</User>
</Action>
</Actions>
<Reject/>
<Requestor>Samuel B. McCain</Requestor>
<User>SMCCAIN</User>
<CostCenter>A10</CostCenter>
<ShippingInstructions>
<name>Samuel B. McCain</name>
<address>800 Bridge Parkway,Redwood Shores,CA,94065,USA</address>
<telephone>650 506 7800</telephone>
</ShippingInstructions>
<SpecialInstructions>Courier</SpecialInstructions>
<LineItems>
<LineItem ItemNumber="1">
<Description>Life of Brian - Monty Python's</Description>
<Part Id="715515010320" Quantity="2" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="2">
<Description>The Night Porter</Description>
<Part Id="37429145227" Quantity="2" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="3">
<Description>Oliver Twist</Description>
<Part Id="37429128121" Quantity="1" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="4">
<Description>Notorious</Description>
<Part Id="715515012720" Quantity="4" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="5">
<Description>In the Mood for Love</Description>
<Part Id="715515012928" Quantity="3" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="6">
<Description>Alphaville</Description>
<Part Id="37429130926" Quantity="2" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="7">
<Description>General Idi Amin Dada</Description>
<Part Id="37429166529" Quantity="4" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="8">
<Description>In the Mood for Love</Description>
<Part Id="715515012928" Quantity="3" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="9">
<Description>Flesh for Frankenstein</Description>
<Part Id="715515009423" Quantity="3" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="10">
<Description>The Killer</Description>
<Part Id="715515008976" Quantity="1" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="11">
<Description>Ballad of a Soldier</Description>
<Part Id="37429167922" Quantity="2" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="12">
<Description>Ordet</Description>
<Part Id="37429158623" Quantity="2" UnitPrice="0"/>
</LineItem>
</LineItems>
</PurchaseOrder>
SQL> begin
2 for x in (select object_value from PURCHASEORDER_XML) loop
3 x.object_value.schemaValidate();
4 end loop;
5 end;
6 /
PL/SQL procedure successfully completed.
SQL>There is no automated way in Oracle XML DB to define an automatic mapping between a set of columns in some existing relational tables and the elements and attributres defined by an XML Schema.
However it is easy solve this problem by using the SQL/XML operators (XMLAGG, XMLELEMENT, XMLFOREST, XMLATTRIBUTES, etc) to generate XML documents that are compliant with an XML Schema directly from a SQL statement.
If the XML Schema is registered with Oracle XML DB and the appropraite Schema Location information is added into the generated document using XMLAttributes then it becomes very easy to ensure that the generated documents are valid.
The following example show an easy way to do this by creating an XML View that contains the documents to be validated.
SQL> drop table PURCHASEORDER_LINEITEM
2 /
Table dropped.
SQL> drop table PURCHASEORDER_REJECTION
2 /
Table dropped.
SQL> drop table PURCHASEORDER_SHIPPING
2 /
Table dropped.
SQL> drop TABLE PURCHASEORDER_ACTION
2 /
Table dropped.
SQL> drop TABLE PURCHASEORDER_TABLE
2 /
Table dropped.
SQL> create table PURCHASEORDER_TABLE
2 (
3 REFERENCE VARCHAR2(28),
4 PRIMARY KEY ("REFERENCE"),
5 REQUESTER VARCHAR2(48),
6 USERID VARCHAR2(32),
7 COSTCENTER VARCHAR2(3),
8 SPECIALINSTRUCTIONS VARCHAR2(2048)
9 )
10 /
Table created.
SQL> create table PURCHASEORDER_ACTION
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 ACTIONEDBY VARCHAR2(32),
6 DATEACTIONED DATE
7 )
8 /
Table created.
SQL> create table PURCHASEORDER_SHIPPING
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 PRIMARY KEY ("REFERENCE"),
6 SHIPTONAME VARCHAR2(48),
7 ADDRESS VARCHAR2(512),
8 PHONE VARCHAR2(32)
9 )
10 /
Table created.
SQL> create table PURCHASEORDER_REJECTION
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 PRIMARY KEY ("REFERENCE"),
6 REJECTEDBY VARCHAR2(32),
7 DATEREJECTED DATE,
8 COMMENTS VARCHAR2(2048)
9 )
10 /
Table created.
SQL> create table PURCHASEORDER_LINEITEM
2 (
3 REFERENCE,
4 FOREIGN KEY ("REFERENCE") REFERENCES "PURCHASEORDER_TABLE" ("REFERENCE") ON DELETE CASCADE,
5 LINENO NUMBER(10),
6 PRIMARY KEY ("REFERENCE","LINENO"),
7 UPC VARCHAR2(14),
8 DESCRIPTION VARCHAR2(128),
9 QUANTITY NUMBER(10),
10 UNITPRICE NUMBER(12,2)
11 )
12 /
Table created.
SQL> insert into PURCHASEORDER_TABLE values ('SMCCAIN-20030109123335470PDT','Samuel B. McCain','SMCCAIN','A10','Courier')
2 /
1 row created.
SQL> insert into PURCHASEORDER_ACTION values ('SMCCAIN-20030109123335470PDT','SVOLLMAN',NULL)
2 /
1 row created.
SQL> insert into PURCHASEORDER_SHIPPING values ('SMCCAIN-20030109123335470PDT','Samuel B. McCain','800 Bridge Parkway,Redwood Shores,CA,9406
5,USA','650 506 7800')
2 /
1 row created.
SQL> insert into PURCHASEORDER_REJECTION values ('SMCCAIN-20030109123335470PDT',null,null,null)
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','1','715515010320','Life of Brian - Monty Python''s','2','39.
95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','2','37429145227','The Night Porter','2','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','3','37429128121','Oliver Twist','1','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','4','715515012720','Notorious','4','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','5','715515012928','In the Mood for Love','3','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','6','37429130926','Alphaville','2','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','7','37429166529','General Idi Amin Dada','4','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','8','715515012928','In the Mood for Love','3','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','9','715515009423','Flesh for Frankenstein','3','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','10','715515008976','The Killer','1','39.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','11','37429167922','Ballad of a Soldier','2','29.95')
2 /
1 row created.
SQL> insert into PURCHASEORDER_LINEITEM values ('SMCCAIN-20030109123335470PDT','12','37429158623','Ordet','2','0')
2 /
1 row created.
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd';
3 :schemaPath := '/public/purchaseOrder.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="tr
ue">
6 <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
7 <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T" xdb:maintainDOM="false">
8 <xs:sequence>
9 <xs:element name="Reference" type="ReferenceType" xdb:SQLName="REFERENCE"/>
10 <xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
11 <xs:element name="Reject" type="RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
12 <xs:element name="Requestor" type="RequestorType" xdb:SQLName="REQUESTOR"/>
13 <xs:element name="User" type="UserType" xdb:SQLName="USERID"/>
14 <xs:element name="CostCenter" type="CostCenterType" xdb:SQLName="COST_CENTER"/>
15 <xs:element name="ShippingInstructions" type="ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
16 <xs:element name="SpecialInstructions" type="SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
17 <xs:element name="LineItems" type="LineItemsType" xdb:SQLName="LINEITEMS"/>
18 </xs:sequence>
19 </xs:complexType>
20 <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T" xdb:maintainDOM="false">
21 <xs:sequence>
22 <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="L
INEITEM_V"/>
23 </xs:sequence>
24 </xs:complexType>
25 <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T" xdb:maintainDOM="false">
26 <xs:sequence>
27 <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESRIPTION"/>
28 <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
29 </xs:sequence>
30 <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
31 </xs:complexType>
32 <xs:complexType name="PartType" xdb:SQLType="PART_T" xdb:maintainDOM="false">
33 <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
34 <xs:simpleType>
35 <xs:restriction base="xs:string">
36 <xs:minLength value="10"/>
37 <xs:maxLength value="14"/>
38 </xs:restriction>
39 </xs:simpleType>
40 </xs:attribute>
41 <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
42 <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
43 </xs:complexType>
44 <xs:simpleType name="ReferenceType">
45 <xs:restriction base="xs:string">
46 <xs:minLength value="18"/>
47 <xs:maxLength value="30"/>
48 </xs:restriction>
49 </xs:simpleType>
50 <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T" xdb:maintainDOM="false">
51 <xs:sequence>
52 <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
53 <xs:complexType xdb:SQLType="ACTION_T" xdb:maintainDOM="false">
54 <xs:sequence>
55 <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
56 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
57 </xs:sequence>
58 </xs:complexType>
59 </xs:element>
60 </xs:sequence>
61 </xs:complexType>
62 <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T" xdb:maintainDOM="false">
63 <xs:all>
64 <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
65 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
66 <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
67 </xs:all>
68 </xs:complexType>
69 <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T" xdb:maintainDOM="false">
70 <xs:sequence>
71 <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
72 <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
73 <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
74 </xs:sequence>
75 </xs:complexType>
76 <xs:simpleType name="moneyType">
77 <xs:restriction base="xs:decimal">
78 <xs:fractionDigits value="2"/>
79 <xs:totalDigits value="12"/>
80 </xs:restriction>
81 </xs:simpleType>
82 <xs:simpleType name="quantityType">
83 <xs:restriction base="xs:decimal">
84 <xs:fractionDigits value="4"/>
85 <xs:totalDigits value="8"/>
86 </xs:restriction>
87 </xs:simpleType>
88 <xs:simpleType name="UserType">
89 <xs:restriction base="xs:string">
90 <xs:minLength value="1"/>
91 <xs:maxLength value="10"/>
92 </xs:restriction>
93 </xs:simpleType>
94 <xs:simpleType name="RequestorType">
95 <xs:restriction base="xs:string">
96 <xs:minLength value="0"/>
97 <xs:maxLength value="128"/>
98 </xs:restriction>
99 </xs:simpleType>
100 <xs:simpleType name="CostCenterType">
101 <xs:restriction base="xs:string">
102 <xs:minLength value="1"/>
103 <xs:maxLength value="4"/>
104 </xs:restriction>
105 </xs:simpleType>
106 <xs:simpleType name="VendorType">
107 <xs:restriction base="xs:string">
108 <xs:minLength value="0"/>
109 <xs:maxLength value="20"/>
110 </xs:restriction>
111 </xs:simpleType>
112 <xs:simpleType name="PurchaseOrderNumberType">
113 <xs:restriction base="xs:integer"/>
114 </xs:simpleType>
115 <xs:simpleType name="SpecialInstructionsType">
116 <xs:restriction base="xs:string">
117 <xs:minLength value="0"/>
118 <xs:maxLength value="2048"/>
119 </xs:restriction>
120 </xs:simpleType>
121 <xs:simpleType name="NameType">
122 <xs:restriction base="xs:string">
123 <xs:minLength value="1"/>
124 <xs:maxLength value="20"/>
125 </xs:restriction>
126 </xs:simpleType>
127 <xs:simpleType name="AddressType">
128 <xs:restriction base="xs:string">
129 <xs:minLength value="1"/>
130 <xs:maxLength value="256"/>
131 </xs:restriction>
132 </xs:simpleType>
133 <xs:simpleType name="TelephoneType">
134 <xs:restriction base="xs:string">
135 <xs:minLength value="1"/>
136 <xs:maxLength value="24"/>
137 </xs:restriction>
138 </xs:simpleType>
139 <xs:simpleType name="DateType">
140 <xs:restriction base="xs:date"/>
141 </xs:simpleType>
142 <xs:simpleType name="CommentsType">
143 <xs:restriction base="xs:string">
144 <xs:minLength value="1"/>
145 <xs:maxLength value="2048"/>
146 </xs:restriction>
147 </xs:simpleType>
148 <xs:simpleType name="DescriptionType">
149 <xs:restriction base="xs:string">
150 <xs:minLength value="1"/>
151 <xs:maxLength value="256"/>
152 </xs:restriction>
153 </xs:simpleType>
154 </xs:schema>
155 ');
156 begin
157 if (dbms_xdb.existsResource(:schemaPath)) then
158 dbms_xdb.deleteResource(:schemaPath);
159 end if;
160 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
161 end;
162 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,FALSE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> create or replace view PURCHASEORDER_XML
2 of xmltype
3 xmlSCHEMA "http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" Element "PurchaseOrder"
4 with object id
5 (
6 substr(extractValue(object_value,'/PurchaseOrder/Reference'),1,32)
7 )
8 as
9 select xmlElement
10 (
11 "PurchaseOrder",
12 xmlAttributes
13 (
14 'http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd' as "xsi:noNamespaceSchemaLocation",
15 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi"
16 ),
17 xmlElement("Reference",p.REFERENCE),
18 xmlElement
19 (
20 "Actions",
21 ( select xmlAgg
22 (
23 xmlElement
24 (
25 "Action",
26 xmlElement("User",ACTIONEDBY),
27 case
28 when DATEACTIONED is not null
29 then xmlElement("Date",DATEACTIONED)
30 end
31 )
32 )
33 from PURCHASEORDER_ACTION a
34 where a.REFERENCE = p.REFERENCE
35 )
36 ),
37 xmlElement
38 (
39 "Reject",
40 xmlForest
41 (
42 REJECTEDBY as "User",
43 DATEREJECTED as "Date",
44 COMMENTS as "Comments"
45 )
46 ),
47 xmlElement("Requestor",REQUESTER),
48 xmlElement("User",USERID),
49 xmlElement("CostCenter",COSTCENTER),
50 xmlElement
51 (
52 "ShippingInstructions",
53 xmlElement("name",SHIPTONAME),
54 xmlElement("address",ADDRESS),
55 xmlElement("telephone",PHONE)
56 ),
57 xmlElement("SpecialInstructions",SPECIALINSTRUCTIONS),
58 xmlElement
59 (
60 "LineItems",
61 ( select xmlAgg
62 (
63 xmlElement
64 (
65 "LineItem",
66 xmlAttributes(LINENO as "ItemNumber"),
67 xmlElement("Description",DESCRIPTION),
68 xmlElement
69 (
70 "Part",
71 xmlAttributes
72 (
73 UPC as "Id",
74 QUANTITY as "Quantity",
75 UNITPRICE as "UnitPrice"
76 )
77 )
78 )
79 )
80 from PURCHASEORDER_LINEITEM l
81 where l.REFERENCE = p.REFERENCE
82 )
83 )
84 )
85 from PURCHASEORDER_TABLE p, PURCHASEORDER_REJECTION r, PURCHASEORDER_SHIPPING s
86 where r.REFERENCE = p.REFERENCE
87 and s.REFERENCE = p.REFERENCE
88 /
View created.
SQL> set long 10000 pages 0 lines 140
SQL> --
SQL> select x.object_value.extract('/*')
2 from PURCHASEORDER_XML x
3 /
<PurchaseOrder xsi:noNamespaceSchemaLocation="http://xfiles:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Reference>SMCCAIN-20030109123335470PDT</Reference>
<Actions>
<Action>
<User>SVOLLMAN</User>
</Action>
</Actions>
<Reject/>
<Requestor>Samuel B. McCain</Requestor>
<User>SMCCAIN</User>
<CostCenter>A10</CostCenter>
<ShippingInstructions>
<name>Samuel B. McCain</name>
<address>800 Bridge Parkway,Redwood Shores,CA,94065,USA</address>
<telephone>650 506 7800</telephone>
</ShippingInstructions>
<SpecialInstructions>Courier</SpecialInstructions>
<LineItems>
<LineItem ItemNumber="1">
<Description>Life of Brian - Monty Python's</Description>
<Part Id="715515010320" Quantity="2" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="2">
<Description>The Night Porter</Description>
<Part Id="37429145227" Quantity="2" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="3">
<Description>Oliver Twist</Description>
<Part Id="37429128121" Quantity="1" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="4">
<Description>Notorious</Description>
<Part Id="715515012720" Quantity="4" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="5">
<Description>In the Mood for Love</Description>
<Part Id="715515012928" Quantity="3" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="6">
<Description>Alphaville</Description>
<Part Id="37429130926" Quantity="2" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="7">
<Description>General Idi Amin Dada</Description>
<Part Id="37429166529" Quantity="4" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="8">
<Description>In the Mood for Love</Description>
<Part Id="715515012928" Quantity="3" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="9">
<Description>Flesh for Frankenstein</Description>
<Part Id="715515009423" Quantity="3" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="10">
<Description>The Killer</Description>
<Part Id="715515008976" Quantity="1" UnitPrice="39.95"/>
</LineItem>
<LineItem ItemNumber="11">
<Description>Ballad of a Soldier</Description>
<Part Id="37429167922" Quantity="2" UnitPrice="29.95"/>
</LineItem>
<LineItem ItemNumber="12">
<Description>Ordet</Description>
<Part Id="37429158623" Quantity="2" UnitPrice="0"/>
</LineItem>
</LineItems>
</PurchaseOrder>
SQL> begin
2 for x in (select object_value from PURCHASEORDER_XML) loop
3 x.object_value.schemaValidate();
4 end loop;
5 end;
6 /
PL/SQL procedure successfully completed.
SQL> -
Insert data into the xml schema-based xmltype table problem!
Hello, there,
I got problem in inserting data into the xmltype table after registered XML schema and created table. details see below:
1) xml schema:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by Constantin Ilea (EMERGIS INC) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.emergis.com/eHealth/EHIP/data/meta/profile:v1" targetNamespace="http://www.emergis.com/eHealth/EHIP/data/meta/profile:v1" elementFormDefault="qualified">
<!-- ************** PART I: BEGIN SIMPLE OBJECT TYPE DEFINITIONS ********************************** -->
<xs:simpleType name="RoutingType">
<xs:restriction base="xs:string">
<xs:enumeration value="Synch"/>
<xs:enumeration value="Asynch"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="StatusType">
<xs:restriction base="xs:string">
<xs:enumeration value="ACTIVE"/>
<xs:enumeration value="VOID"/>
<xs:enumeration value="PENDING"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SenderApplicationType">
<xs:restriction base="xs:string">
<xs:enumeration value="PR"/>
<xs:enumeration value="CR"/>
<xs:enumeration value="POS"/>
<xs:enumeration value="CPP"/>
<xs:enumeration value="Other"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ServiceTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="IS"/>
<xs:enumeration value="WS"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="RouteDirect">
<xs:restriction base="xs:string">
<xs:enumeration value="Request"/>
<xs:enumeration value="Reply"/>
<xs:enumeration value="None"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Indicator">
<xs:annotation>
<xs:documentation>can we also change the value to "ON" and "OFF" instead? in this way this cn be shared by all type of switch indicator</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="YES"/>
<xs:enumeration value="NO"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="RuleType">
<xs:restriction base="xs:string">
<xs:enumeration value="ControlAct"/>
<xs:enumeration value="WSPolicy"/>
<xs:enumeration value="AccessControl"/>
<xs:enumeration value="Certification"/>
<xs:enumeration value="MessageConformance"/>
<xs:enumeration value="Variant"/>
<xs:enumeration value="Routing"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="HL7Result">
<xs:restriction base="xs:string">
<xs:enumeration value="ACCEPT"/>
<xs:enumeration value="REFUSE"/>
<xs:enumeration value="REJECT"/>
<xs:enumeration value="ACK"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="IIPType">
<xs:restriction base="xs:string">
<xs:enumeration value="PUT"/>
<xs:enumeration value="GET/LIST"/>
<xs:enumeration value="NOTIF"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ProfileTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="IIPProfile"/>
<xs:enumeration value="BizOperationProfile"/>
<xs:enumeration value="OrchestrationProfile"/>
<xs:enumeration value="DomainObjectProfile"/>
<xs:enumeration value="ServiceProfile"/>
<xs:enumeration value="ExceptionProfile"/>
<xs:enumeration value="CustomizedProfile"/>
<xs:enumeration value="SystemProfile"/>
<xs:enumeration value="HL7XMLSchemaProfile"/>
<xs:enumeration value="EnricherParametersProfile"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ParameterType">
<xs:restriction base="xs:string">
<xs:enumeration value="String"/>
<xs:enumeration value="Object"/>
<xs:enumeration value="Number"/>
<xs:enumeration value="Document"/>
</xs:restriction>
</xs:simpleType>
<!-- ************** PART I: END SIMPLE OBJECT TYPE DEFINITIONS ********************************** -->
<!-- ************** PART II: BEGIN COMPLEX OBJECT TYPE DEFINITIONS ********************************** -->
<!-- *********************** begin new added objects, by rshan *************************************** -->
<xs:complexType name="ProfileType">
<xs:annotation>
<xs:documentation>
1.Profile IS USED TO BE AN WRAPPER ELEMENT FOR ALL KIND OF PROFILES NO MATTER WHAT KIND OF PROFILE IT IS
2.ProfileID used to uniquely identify the current profile
3.ProfileData used to hold all the necessary profile related data
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="ProfileID" type="ProfileIDType">
<xs:annotation>
<xs:documentation>this will hold all the common attributes, espically the global unique identifier to the profile, no matter what type of profile is</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ProfileData" type="ProfileDataType">
<xs:annotation>
<xs:documentation>all the non-common profile meta data that attached to each specific profile type such as IIPProfile, OrchestrationProfile, and BizOperationProfile will be placed here</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProfileIDType">
<xs:annotation>
<xs:documentation>global unique identifier and all the common attributes across all different profiles, the @ID and @Type together will be used as the primary key to identify the profile data</xs:documentation>
</xs:annotation>
<xs:attribute name="ID" type="xs:ID" use="required">
<xs:annotation>
<xs:documentation>ID is the global unique identifier to the profile, no matter what type of profile it is</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Name"/>
<xs:attribute name="Description"/>
<xs:attribute name="Version">
<xs:annotation>
<xs:documentation>version of the profile data</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Type" type="ProfileTypeType" use="required">
<xs:annotation>
<xs:documentation>value to identify the ProfileType type within
IIPProfile,BizOperationProfile,OrchestrationProfile,DomainObjectProfile
ServiceProfile,ExceptionProfile,SystemProfile,HL7XMLSchemaProfile,
EnricherParametersProfile,CustomizedProfile
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Status" type="StatusType" default="ACTIVE">
<xs:annotation>
<xs:documentation>used to show the related profile data status like "ACTIVE","PENDING","VOID"...</xs:documentation>
</xs:annotation>
</xs:attribute>
<!--
<xs:sequence>
<xs:element name="ProfileReference" type="ProfileIDType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>this will be the place to hold the integrity relationship with other profiles like foreign key if existed and necessary to show up</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
-->
</xs:complexType>
<xs:complexType name="ProfileDataType">
<xs:annotation>
<xs:documentation>meta data associated tightly to each specific type of profile</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="EnricherParametersProfileData" type="EnricherParametersDataType">
<xs:annotation>
<xs:documentation>Enricher Parameters related profile data
1. one instance of this type may contains all the related System metadata.
2. idType part may use to identify different version/release/status
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ExtendProfileData" type="ExtendProfileDataType">
<xs:annotation>
<xs:documentation>If needed, any profile data not defined within the current release scope can be added here </xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:complexType name="ExtendProfileDataType">
<xs:sequence>
<xs:element name="ExtendProfile" type="xs:anyType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EnricherParametersDataType">
<xs:sequence>
<xs:element name="EnricherParameter" type="EnricherParameter" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EnricherParameter">
<xs:sequence>
<xs:element ref="Enricher"/>
</xs:sequence>
<xs:attribute name="serviceName" type="xs:string" use="required"/>
<xs:attribute name="interactionID" type="xs:string"/>
</xs:complexType>
<xs:element name="Enricher">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Parameters" type="Parameters"/>
<xs:element ref="Section" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ValueType">
<xs:attribute name="field" use="required"/>
<xs:attribute name="value"/>
<xs:attribute name="action"/>
</xs:complexType>
<xs:element name="Section">
<xs:complexType>
<xs:sequence>
<xs:element name="Value" type="ValueType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="Section" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="path" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="Parameters">
<xs:sequence>
<xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="reference"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RuleList">
<xs:annotation>
<xs:documentation>an array of rules</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Rule" type="RuleProfile" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RuleProfile">
<xs:attribute name="RName" use="required"/>
<xs:attribute name="RType" type="RuleType" use="required"/>
<xs:attribute name="Status" default="ON">
<xs:annotation>
<xs:documentation>By default is ON (or if is missing)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Order"/>
<xs:attribute name="Direction" type="RouteDirect">
<xs:annotation>
<xs:documentation>Request / Reply</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- ************** PART II: END COMPLEX OBJECT TYPE DEFINITIONS *********************************** -->
<!-- ************** PART III: BEGIN ROOT ELEMENTS DEFINITIONS ********************************* -->
<!-- 0) Profile wrapper root element
Profile IS USED TO BE AN WRAPPER ELEMENT FOR ALL KIND OF PROFILES NO MATTER WHAT KIND OF PROFILE IT IS
-->
<xs:element name="Profile" type="ProfileType">
<xs:annotation>
<xs:documentation>Profile IS USED TO BE AN WRAPPER ELEMENT FOR ALL KIND OF PROFILES NO MATTER WHAT KIND OF PROFILE IT IS</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
2)register xml schema:
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaurl=>'http://rac3-1-vip:8080/home/'||USER||'/xsd/EHIPProfile_v00.xsd',
5 schemadoc=>xdbURIType('/home/'||USER||'/xsd/EHIPProfile_v00.xsd').getClob(),
6 local=>True,
7 gentypes=>True,
8 genbean=>False,
9 gentables=>False
10 );
11 End;
12 /
PL/SQL procedure successfully completed.
SQL>
SQL>
3) xml data:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<Profile xmlns="http://www.emergis.com/eHealth/EHIP/data/meta/profile:v1">
<ProfileID Type="EnricherParametersProfile" Status="ACTIVE" ID="EnricherPP.ID.0001" Name="EnricherPP.ID.0001" Description="EnricherPP.ID.0001" Version="01"/>
<ProfileData>
<EnricherParametersProfileData>
<EnricherParameter serviceName="LRS_BusinessDomainObject.lrs.businessDomainObject.domainObjectBuilder.concrete.ExceptionCreators:createExceptionV50CategoryCanonicalPart" interactionID="">
<Enricher>
<Parameters>
<Parameter name="MESSAGE_ID" reference="test"/>
</Parameters>
<Section path="HEADER">
<Section path="RESPONSE_TYPE">
<Value field="value" value="I"/>
</Section>
<Section path="HL7_STANDARD_VERSION">
<Value field="value" value="HL7V3"/>
</Section>
<Section path="DESIRED_ACKNOWLEDGMENT_TYPE">
<Value field="value" value="NE"/>
</Section>
<Section path="SENDING_NETWORK_ADDRESS">
<Value field="value" value=""/>
</Section>
<Section path="SENDING_APPLICATION_IDENTIFIER">
<Value field="root" value="2.16.840.1.113883.3.133.1.3"/>
<Value field="extension" value=""/>
</Section>
<Section path="SENDING_APPLICATION_NAME">
<Value field="value" value="NL HIAL"/>
</Section>
</Section>
</Enricher>
</EnricherParameter>
<EnricherParameter serviceName="LRS_BusinessDomainObject.lrs.businessDomainObject.domainObjectBuilder.concrete.DomainObjectCreators:createFindClientsAssociatedIdentifersRequestObject" interactionID="PRPA_IN101105CA">
<Enricher>
<Parameters>
<Parameter name="MESSAGE_ID" reference="test"/>
</Parameters>
<Section path="HEADER">
<Section path="RESPONSE_TYPE">
<Value field="value" value="I"/>
</Section>
<Section path="HL7_STANDARD_VERSION">
<Value field="value" value="HL7V3"/>
</Section>
<Section path="PROCESSING_CODE">
<Value field="value" value="T"/>
</Section>
<!--
<Section path="PROCESSING_MODE_CODE">
<Value field="value" value="T"/>
</Section>
-->
<Section path="DESIRED_ACKNOWLEDGMENT_TYPE">
<Value field="value" value="NE"/>
</Section>
<Section path="RECEIVER_NETWORK_ADDRESS">
<Value field="value" value="prsunew.moh.hnet.bc.ca"/>
</Section>
<Section path="RECEIVER_APPLICATION_IDENTIFIER">
<Value field="root" value="2.16.840.1.113883.3.40.5.1"/>
<Value field="extension" value=""/>
</Section>
<Section path="SENDING_NETWORK_ADDRESS">
<Value field="value" value=""/>
</Section>
<Section path="SENDING_APPLICATION_IDENTIFIER">
<Value field="root" value="2.16.840.1.113883.3.133.1.3"/>
<Value field="extension" value=""/>
</Section>
<Section path="SENDING_APPLICATION_NAME">
<Value field="value" value="NL HIAL"/>
</Section>
</Section>
</Enricher>
</EnricherParameter>
<EnricherParameter serviceName="LRS_BusinessDomainObject.lrs.businessDomainObject.domainObjectBuilder.concrete.DomainObjectContentEnrichers:enrichPRRequest" interactionID="">
<!--Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<Enricher>
<Parameters>
<Parameter name="MESSAGE_IDENTIFIER" reference="test"/>
</Parameters>
<Section path="HEADER">
<Section path="HL7_STANDARD_VERSION">
<Value field="value" value="V3PR2"/>
</Section>
<!--POS/CPP populated ?-->
<!--Not sure if this should be set as a variance within EHIP or if we expect the POS/CPP to provide this value-->
<Section path="PROCESSING_CODE">
<Value field="value" value="T"/>
</Section>
<!--POS/CPP populated ?-->
<Section path="PROCESSING_MODE_CODE">
<Value field="value" value="T"/>
</Section>
<!--POS/CPP populated ?-->
<Section path="DESIRED_ACKNOWLEDGMENT_TYPE">
<Value field="value" value="NE"/>
</Section>
<!-- note:We Expect PRS to give us a web service address -->
<!--<Section path="RECEIVER_NETWORK_ADDRESS">
<Value field="value" value="_http://PRSServer/svcName"/>
</Section>
-->
<Section path="RECEIVER_APPLICATION_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.3.40.1.14"/>
<Value field="extension" value="SIT1"/>
</Section>
<!-- note: values of the fields to be provided by PRS -->
<Section path="RECEIVER_APPLICATION_NAME[0]">
<Value field="value" value="receiverAppName"/>
</Section>
<!-- note: RECEIVER_ORGANIZATION has an extra trailing space, as in the Excel mapping spreadsheet -->
<!-- note: values of the fields to be specified by PRS later -->
<Section path="RECEIVER_AGENT/RECEIVER_ORGANIZATION/RECEIVER_ORGANIZATION_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.3.40.4.1"/>
<Value field="extension" value="receiverOrgId"/>
</Section>
<Section path="SENDING_APPLICATION_NAME[0]">
<Value field="value" value="NLPRSCLNT"/>
</Section>
<!-- note: SENDING_ORGANIZATION has an extra trailing space, as in the Excel mapping spreadsheet -->
<!-- note: values of the fields to be specified by PRS later -->
<Section path="SENDING_AGENT/SENDING_ORGANIZATION/SENDING_ORGANIZATION_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.4.3.57"/>
<Value field="extension" value="3001"/>
</Section>
<Section path="PERFORMER/HEALTHCARE_WORKER_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.4.3.57"/>
<Value field="extension" value="HIAL_USR"/>
</Section>
</Section>
<Section path="PAYLOAD">
<!--<Section path="QUERY_STATUS_CODE">
<Value field="value" value="New"/>
</Section>-->
<!-- note: AUDIT has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="AUDIT[0]/AUDIT_INFORMATION">
<Value field="code" value="LATEST"/>
<Value field="codeSystem" value="PRSAuditParameters"/>
</Section>
<!-- note: CONFIDENCE has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="CONFIDENCE/CONFIDENCE_VALUE">
<Value field="value" value="100"/>
</Section>
<!-- note: HISTORY has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="HISTORY/INCLUDE_HISTORY_INDICATOR">
<Value field="value" value="false"/>
</Section>
<!-- note: JURISDICTION has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="JURISDICTION/JURISDICTION_TYPE">
<Value field="value" value="NL"/>
</Section>
<!-- note: RESPONSE_OBJECT has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[0]">
<Value field="code" value="GRS_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[1]">
<Value field="code" value="GRS_ELECTRONIC_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[2]">
<Value field="code" value="GRS_IDENTIFIER"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[3]">
<Value field="code" value="GRS_ORGANIZATION_NAME"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[4]">
<Value field="code" value="GRS_PERSONAL_NAME"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[5]">
<Value field="code" value="GRS_REGISTRY_IDENTIFIER"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[6]">
<Value field="code" value="GRS_TELEPHONE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[7]">
<Value field="code" value="PRS_CONDITION"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[8]">
<Value field="code" value="PRS_CONFIDENTIALITY_INDICATOR"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[9]">
<Value field="code" value="PRS_DEMOGRAPHIC_DETAIL"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[10]">
<Value field="code" value="PRS_DISCIPLINARY_ACTION"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[11]">
<Value field="code" value="PRS_INFORMATION_ROUTE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[12]">
<Value field="code" value="PRS_NOTE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[13]">
<Value field="code" value="PRS_PROVIDER_CREDENTIAL"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[14]">
<Value field="code" value="PRS_PROVIDER_EXPERTISE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[15]">
<Value field="code" value="PRS_PROVIDER_RELATIONSHIP"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[16]">
<Value field="code" value="PRS_STATUS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[17]">
<Value field="code" value="PRS_WORK_LOCATION"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[18]">
<Value field="code" value="PRS_WORK_LOCATION_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[19]">
<Value field="code" value="PRS_WORK_LOCATION_DETAIL"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[20]">
<Value field="code" value="PRS_WORK_LOCATION_ELECTRONIC_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[21]">
<Value field="code" value="PRS_WORK_LOCATION_INFORMATION_ROUTE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[22]">
<Value field="code" value="PRS_WORK_LOCATION_TELEPHONE"/>
</Section>
<!-- note: ROLE_CLASS has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="ROLE_CLASS /ROLE_CLASS_VALUE">
<Value field="value" value="LIC"/>
</Section>
<Section path="SORT_CONTROL[0]/SORT_CONTROL_ELEMENT_NAME">
<Value field="code" value="PrincipalPerson.name.value.family"/>
</Section>
<Section path="SORT_CONTROL[0]/SORT_CONTROL_DIRECTION_CODE">
<Value field="value" value="A"/>
</Section>
</Section>
</Enricher>
</EnricherParameter>
</EnricherParametersProfileData>
</ProfileData>
</Profile>
the data is valid against the schema through XML Spy tool... and loaded into the XDB repository...
4) create table and insert data:
SQL> CREATE TABLE EHIP_PROFILE OF SYS.XMLTYPE
2 XMLSCHEMA "http://rac3-1-vip:8080/home/EHIPSBUSER1/xsd/EHIPProfile_v00.xsd" ELEMENT "Profile"
3 ;
Table created.
SQL>
SQL> alter table EHIP_PROFILE
2 add CONSTRAINT EHIP_PROF_PK PRIMARY KEY(XMLDATA."ProfileID"."ID",XMLDATA."ProfileID"."Type");
Table altered.
SQL>
SQL>
SQL>
SQL>
SQL> select xdbURIType('/home/'||USER||'/ProfileData/EnricherPP.ID.0001.xml').getClob() from dual;
XDBURITYPE('/HOME/'||USER||'/PROFILEDATA/ENRICHERPP.ID.0001.XML').GETCLOB()
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy
SQL>
SQL>
SQL> insert into ehip_profile values(xmltype.createXML(xdbURIType('/home/'||USER||'/ProfileData/EnricherPP.ID.0001.xml').getClob()));
insert into ehip_profile values(xmltype.createXML(xdbURIType('/home/'||USER||'/ProfileData/EnricherPP.ID.0001.xml').getClob()))
ERROR at line 1:
ORA-21700: object does not exist or is marked for delete
what's the problem caused the "ORA-21700: object does not exist or is marked for delete" error?
Thanks in advance for your help?Thanks Marco,
Here're my environment:
SQL> select INSTANCE_NUMBER, INSTANCE_NAME,HOST_NAME,VERSION from v$instance;
INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION
2 rac32 RAC3-2 10.2.0.3.0
I followed your suggested in the above, and always purge recyclebin, but still got the same problem. because in 10gr2, there's no dbms_xmlschema.purge_schema available,
and I did checked the recyclebin after force the delete of schema, nothing inside. any other recommendation? -
Facing problem in xml schema xsd file registration
Hi,
i am facing problem in xml schema xsd file registration when
the number of column is more. It is showing persing error.
if i am deleting few column from xsd file . It is working otherwise
showing error. Is there any solution for that please suggest me.
The Error is
ORA-31011:XML parsing failed
ORA_19202: Error occurred in XML processing
LPX-00230 : (message vary time to time-like invalid tag ending etc.)
Regards
Manoranjan
and thanks in advanceWhere is you XML coming from. Are you sure it's valid. If you are hard coding it as a SQL String constant are you hitting the 4k / 32K limit on the size of SQL / PL/SQL constant. Have you tried loading the content from a bfile..
-
Java Stored Procedure SAXParser XML Schema Validation
Using Oracle XML Developers Kit 10.2.0.2.0 - Production.
Attempting to validate using XML Schema in a Java stored procedure with the code:
if ( schemaDoc == null )
// Obtain default connection
Connection conn = new OracleDriver().defaultConnection();
OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement("SELECT XmlDocObj FROM XmlDoc WHERE XmlDocNbr = 2");
OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
if ( rset.next() )
// get the XMLType
XMLType schemaXml = (XMLType)rset.getObject(1);
XSDBuilder builder = new XSDBuilder();
XMLSchema schemaDoc = (XMLSchema)builder.build(new InputSource(schemaXml.getInputStream()));
if ( inst == null )
inst = new ValidateCoreRequest();
ErrorHandlerImpl handler = inst.getNewErrorHandler();
SAXParser saxParser = new SAXParser();
saxParser.setXMLSchema(schemaDoc);
saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
saxParser.setErrorHandler(handler);
saxParser.parse(new InputSource(new StringReader(docStr)));
if( handler.validationError )
errorMsg[0] = handler.saxParseException.getMessage().substring(0, Math.min(199, handler.saxParseException.getMessage().length()));
Never reports validation errors in the XML. Although the XDK Programmers Guide states "...you can use
the oracle.xml.parser.schema.XSDBuilder class to build an XML schema and
then configure the parser to use it by invoking the XMLParser.setXMLSchema()
method. In this case, the XML parser automatically sets the validation mode to
SCHEMA_STRICT_VALIDATION and ignores the schemaLocation and
noNamespaceSchemaLocation attributes." No validation seems to occur. I have tried to set an xsi:noNamespaceSchemaLocation attribute on the root XML node, but this results in URL errors if the URL is not valid or schema build errors if the URL is valid, but does not point to a real location.
It appears that without a schema location attribute, no schema validation occurs. Using setXMLSchema() with a database source does not seem to cause the schema location attributes to be ignored. At least for Java stored procedures.
Does XML Schema validation work in the database for externally referenced schemas?
Thank You,
Art<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jan Vissers ([email protected]):
I have two schemas A and B. A contains a java stored procedure which calls a java stored procedure stored in B. Upon resolving the "A" Java Stored Procedures I get the following error:
ORA-29545: badly formed class: at offset 3093 of Adapter.TFADPBeschikbaarheid.sendAanvraag expecting a class-oracle.xml.parser.v2.XMLDocument but encountered a class-oracle.xml.parser.v2.XMLDocument.
... Question:
it is expecting something which it has in fact encountered... SO!!!! What is the error.
Thx,
Jan<HR></BLOCKQUOTE>
Try this:
Edit your XSU installation script located on lib directory of Oracle XSU's distribution:
Find the line:
loadjava -r -v -u $USER_PASSWORD xmlparserv2.jar
Replace by:
loadjava -r -v -g public -u $USER_PASSWORD xmlparserv2.jar
And installs your Oracle XSU again.
Best regards, Marcelo. -
Sorry for this post, because it really isn't a weblogic specific thing, but I can't
find my answer
anywhere else.
I am attempting to validate my xml file using an XML Schema file. The XML
Schema code looks like this:
<xsd:element name="operatingSystem">
<xsd:simpleType>
<xsd:list>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value=".*(w|W)(I|i)(n|N).*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:list>
</xsd:simpleType>
</xsd:element>
The XML snippet looks like this:
<operatingSystem>Windows 2000</operatingSystem>
The error that I'm getting when using the SaxParser is the following:
org.xml.sax.SAXException: cvc-pattern-valid: Value '2000' is not facet-v
alid with respect to pattern '.*(w|W)(I|i)(n|N).*' for type 'null'.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at SAXLocalNameCount.main(SAXLocalNameCount.java:272)
Somehow, the validation breaks my one string in the operatingSystem tag into
two separate strings to be validated. Can anybody give me some advice on
what to do?
Thanks in advance,
Joelfor some reason it does not like a space between "Windows" and "2000" any
character other than space is fine...
"Joel" <[email protected]> wrote in message
news:3fa9468b$[email protected]..
>
Sorry for this post, because it really isn't a weblogic specific thing,but I can't
find my answer
anywhere else.
I am attempting to validate my xml file using an XML Schema file. The XML
Schema code looks like this:
<xsd:element name="operatingSystem">
<xsd:simpleType>
<xsd:list>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value=".*(w|W)(I|i)(n|N).*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:list>
</xsd:simpleType>
</xsd:element>
The XML snippet looks like this:
<operatingSystem>Windows 2000</operatingSystem>
The error that I'm getting when using the SaxParser is the following:
org.xml.sax.SAXException: cvc-pattern-valid: Value '2000' is not facet-v
alid with respect to pattern '.*(w|W)(I|i)(n|N).*' for type 'null'.
at org.apache.xerces.parsers.AbstractSAXParser.parse(UnknownSource)
at SAXLocalNameCount.main(SAXLocalNameCount.java:272)
Somehow, the validation breaks my one string in the operatingSystem taginto
two separate strings to be validated. Can anybody give me some advice on
what to do?
Thanks in advance,
Joel -
Mapping CLOB and Long in xml schema
Hi,
I am creating an xml schema to map some user defined database objects. For example, for a column which is defined as VARCHAR2 in the database, I have the following xsd type mapping.
<xsd:element name="Currency" type="xsd:string" />
If the oracle column is CLOB or Long(Oracle datatype), could you please tell me how I can map it in the xml schema? I do not want to use Oracle SQL type like:
xdb:SQLType="CLOB" since I need a generic type mapping to CLOB. Would xsd:string still hold good for CLOB as well as Long(Oracle datatype) ?
Please help.
Thanks,
Vadi.The problem is that LONGs are not buffered but are read from the wire in the order defined. The problem is the same as
rs = stmt.executeQuery("select myLong, myNumber from tab");
while (rs.next()) {
int n = rs.getInt(2);
String s = rs.getString(1);
The above will fail for the same reason. When the statement is executed the LONG is not read immediately. It is buffered in the server waiting to be read. When getInt is called the driver reads the bytes of the LONG and throws them away so that it can get to the NUMBER and read it. Then when getString is called the LONG value is gone so you get an exception.
Similar problem here. When the query is executed the CLOB and BLOB locators are read from the wire, but the LONG is buffered in the server waiting to be read. When Clob.getString is called, it has to talk to the server to get the value of the CLOB, so it reads the LONG bytes from the wire and throws them away. That clears the connection so that it can ask the server for the CLOB bytes. When the code reads the LONG value, those bytes are gone so you get an exception.
This is a long standing restriction on using LONG and LONG RAW values and is a result of the network protocol. It is one of the reasons that Oracle deprecates LONGs and recommends using BLOBs and CLOBs instead.
Douglas
Maybe you are looking for
-
Core switches experience High CPU while generating syslog report from LMS
Hi Everyone, Are there anyone who experience that the CPU utilization of some devices went up while generating a report from RME. Basing from other monitoring tool SNMP is taking up a huge cpu process. Any idea why this happened considering that the
-
Xcelsius Installation and Configurations
Hi Experts, Could anyone help me how to install and configure Xcelsius and work on this ? I am very new to this tool and need to develop some reports and publish in SAP and SP portals. Regards, Suresh
-
ERROR 17 ipad mini update IOS 8
I was updating my ipad mini with retina display to the IOS8 . half way trough, the process stoped and there is a black screen with the itunes logo and a cable showing up in The ipad screen . also, there is an "error 17" coming up on my mac. i cann
-
V51S_HU_UPDATE_DB function module....
Hi All, Can someone help me out in telling me, what does function module-V51S_HU_UPDATE_DB do regarding update of any field of a table. Regards, Mainak.
-
Database buffer cashe and process
Hi, gurus. Can't you help me to understand how buffer cashe works. Oracle 11g Concepts 8-3 Before reading a data block into the cache, the process must first find a free buffer. The process searches the LRU list, starting at the least recently used e