Adding a document to XMLTYPE table with schema
Hi all:
I am doing an example to create a table with a
registered schema associated (in Oracle9ir2), and i am
trying to insert a document that fits to schema into the
table.
The example is very simple:
I have the following schema:
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<element name="items">
<complexType>
<sequence>
<element name="item" type="string" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
I succeed in registering the schema:
begin
DBMS_XMLSCHEMA.registerSchema(
'http://localhost/items.xsd',
getDocument('items.xsd'),
TRUE, TRUE, FALSE, FALSE
end;
I succeed in creating a table with this schema:
CREATE TABLE items of XMLType
XMLSCHEMA "http://localhost/items.xsd"
ELEMENT "items";
And i have the following document:
<?xml version="1.0"?>
<items xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://localhost/items.xsd">
<item>Item1</item>
<item>Item2</item>
</items>
But when i try to insert it into the table with:
INSERT INTO items VALUES (XMLTYPE(getDocument('items1.xml')));
(getDocument is exactly the same as in XML Database
Developer's Guid[i]Long postings are being truncated to ~1 kB at this time.
truncated mail continuation...
(getDocument is exactly the same as in XML Database
Developer's Guide - Oracle XML DB Release 2 (9.2))
I get:
SQL> INSERT INTO items VALUES (XMLTYPE(getDocument('items1.xml')));
INSERT INTO items VALUES (XMLTYPE(getDocument('items1.xml')))
ERROR at line 1:
ORA-19007: Schema and element do not match
Do you know which is the problem?
I have proved changing the headers of the xml document
and schema in severals way, but it doesn't work.
Could be a problem with Oracle configuration?
Thanks in advance,
Mario Barcala
Similar Messages
-
Training an SVM on table with schema flexibility fails
Dear colleagues,
I'm trying to train a Support Vector Machine on a table with schema flexibility.
On a small test table with only a couple of columns both the training and the prediction using the PAL libraries work fine. However, on my large sparse table with more than 1000 columns and "schema flexibility" set at creation time, I constantly run into the following error:
Could not execute 'CALL SYSTEM.AFL_WRAPPER_GENERATOR ('PAL_SV', 'AFLPAL', 'SVMTRAIN', PAL_SV_SIGNATURE)' in 30 ms 529 µs .
SAP DBTech JDBC: [423]: AFL error: [423] "SYSTEM"."AFL_WRAPPER_GENERATOR": line 32 col 1 (at pos 1346): [423] (range 3) AFL error exception: AFL error: registration finished with errors, see indexserver trace
The indexserver trace gives me something strange like:
AFLPM_SQLDriverObj.cpp(02439) : aflpm_creator : direction must be in or out
As far as I see it, all parameters are fine, though.
Is there a limitation that does not allow PAL functions to be executed on tables with schema flexibility? I suspect so, because I'm running into similar problems with the SUBSTITUTE_MISSING_VALUES function.
Thanks for any help,
DanielHey there,
isn't there anyone who came across this issue? I'd love to know if this is a known technical limitation with tables that use the "schema flexibility" or rather a bug. In the former case, can anyone suggest a workaround?
I'd be grateful for any help or any pointer to further documentation.
Best,
Daniel -
ORA-00600 problem when create XMLType table with registerd schema
Hi,
I am using Oracle9i Enterprise Edition Release 9.2.0.4.0 on RedHat Linux 7.2
I found a problem when I create table with registered schema with follow content:
<xs:element name="body">
<xs:complexType>
<xs:sequence>
</xs:sequence>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="class" type="xs:NMTOKENS"/>
<xs:attribute name="style" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="body.content">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="p"/>
<xs:element ref="hl2"/>
<xs:element ref="nitf-table"/>
<xs:element ref="ol"/>
</xs:choice>
<xs:attribute name="id" type="xs:ID"/>
</xs:complexType>
</xs:element>
Does Oracle not support element reference to other element with dot?
For instance, body -> body.content
Thanks for your attention.Sorry, amendment on the schema
<xs:element name="body">
<xs:complexType>
<xs:sequence>
<xs:element ref="body.head" minOccurs="0"/>
<xs:element ref="body.content" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="body.end" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="class" type="xs:NMTOKENS"/>
<xs:attribute name="style" type="xs:string"/>
</xs:complexType>
</xs:element> -
Problem naming table with schema prefix in Trigger
Hi,
When i try to compile the trigger having that body :
BEGIN
Insert into TechDb.DocumentTransfers(DocumentNumber, DocumentTypeID, StaffCodeFrom,
StaffCodeTo, TransferType, TransferDate)
values (:New.DocumentNumber, :New.DocumentTypeID, :New.StaffCode,
:New.StaffCode, :New.LastOperation, :New.DocumentDate);
END;
I get the following error :
Line # = 2 Column # = 4 Error Text = PLS-00201: identifier 'DOCUMENTTRANSFERS' must be declared
I noticed that the error disappears works if i don't need to prefix the DOCUMENTTRANFERS table with the schema name.
I am missing something ?
Thanks very much for your help.
Christian MoungouThanks John and Todd. It works exactly as you said.
But, does that mean i will have to directly grant the access right to all the users who will do the action which activates the trigger ?
Just to confirm : I assume that the user who executes the trigger is the user who does the action that activates the trigger ?
Christian -
Dropping a column in composite xmltype table with virtual column
Hello,
i found some interesting behavior. I have a table with xmltype column and a virtual column. If i drop a column, which has an index smaller than the index for the xmltype column, than the virtual column reference for xmltype column is not changed.
select * from v$version;
drop table t_xml purge;
create table t_xml( c1 number,
c2 number,
cxml xmltype,
c3 number,
xmlflag number as (nvl2(cxml,1,0)));
select * from t_xml;
alter table t_xml drop column c2;
select * from t_xml; The 2nd select will result in error:
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> alter table t_xml drop column c2;
Tabelle wurde geändert.
SQL>
SQL> select * from t_xml;
select * from t_xml
FEHLER in Zeile 1:
ORA-00904: "SYS_NC00004$": ungültiger BezeichnerNow the virtual column xmlflag references still the old hidden column for cxml (SYS_NC00004$). It not references the new hidden column, which is now SYS_NC00003$.
I think, it is a bug! Can someone inform oracle? I have no access to metalink.Hi,
Please try this code:
loop at int_inv into wa_inv.
lv_count = lv_count + 1.
AT END OF posnr. <------- The field you want to sum..
gs_total-posnr = wa_inv-posnr.
gs_total-cov_total = lv_count.
APPEND gs_total TO gt_total.
CLEAR : gs_total,
lv_count,
wa_inv.
ENDAT.
ENDLOOP. -
Insert performance on a table with schema based XMLType column
Hi,
We are inserting around 500K rows into a table which has one XMLType column (schema based). Schema is simple and the size of the XMLType column is also not very large (on an average only around 100 bytes (max might be around 1k-2k), but it takes around 1 hr for every 20K rows, which seems very slow.
The schema is like this :
<schema targetNamespace="http://www.citadon.com/xml/test.xsd"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
xdb:storeVarrayAsTable="true"
version="1.0" elementFormDefault="qualified">
<element name="cas">
<complexType>
<sequence>
<element name="ca" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="id" type="string"/>
<element name="value" type="string"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
Any thoughts on how to improve performance?
-SriniYou need to have sufficient data.. Also the event show in the following code may help depending on the nature of the query....
Note in the PurchaseOrder Example if I only have 133 docs, instead of 10,000 I will get tablescan and index full scans
C:\oracle\xdb\bugs\xdbBasicDemo>sqlplus /nolog @testcase XDBTEST XDBTEST
SQL*Plus: Release 10.1.0.3.0 - Production on Fri Aug 27 22:57:36 2004
Copyright (c) 1982, 2004, 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 10000
SQL> set feedback on
SQL> set lines 132
SQL> set pages 50
SQL> --
SQL> drop index iPartNumberIndex
2 /
Index dropped.
Elapsed: 00:00:02.25
SQL> alter index LINEITEM_LIST rebuild
2 /
Index altered.
Elapsed: 00:00:02.15
SQL> desc PURCHASEORDER
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://localhost:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" Element "Pu
ject-relational TYPE "PURCHASEORDER_T"
SQL> --
SQL> col level format 99999
SQL> col parent_table_column format A32
SQL> col table_name format A32
SQL> col table_type_name format A32
SQL> --
SQL> select level, PARENT_TABLE_COLUMN, TABLE_TYPE_NAME, TABLE_NAME
2 from USER_NESTED_TABLES
3 connect by PRIOR TABLE_NAME = PARENT_TABLE_NAME
4 start with PARENT_TABLE_NAME = 'PURCHASEORDER'
5 /
LEVEL PARENT_TABLE_COLUMN TABLE_TYPE_NAME TABLE_NAME
1 "XMLDATA"."ACTIONS"."ACTION" ACTION_V ACTION_TABLE
1 "XMLDATA"."LINEITEMS"."LINEITEM" LINEITEM_V LINEITEM_TABLE
2 rows selected.
Elapsed: 00:00:13.60
SQL> desc LINEITEM_T
LINEITEM_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
ITEMNUMBER NUMBER(38)
DESCRIPTION VARCHAR2(256 CHAR)
PART PART_T
SQL> --
SQL> desc PART_T
PART_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
PART_NUMBER VARCHAR2(14 CHAR)
QUANTITY NUMBER(12,2)
UNITPRICE NUMBER(8,4)
SQL> --
SQL> select count(*)
2 from purchaseorder
3 /
COUNT(*)
10000
1 row selected.
Elapsed: 00:00:05.31
SQL> select count(*)
2 from purchaseorder,
3 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
4 /
COUNT(*)
148814
1 row selected.
Elapsed: 00:09:40.54
SQL> create index iPartNumberIndex
2 on LINEITEM_TABLE l
3 ( l.PART.PART_NUMBER,NESTED_TABLE_ID)
4 /
Index created.
Elapsed: 00:00:36.11
SQL> explain plan for
2 select count(*)
3 from purchaseorder
4 where existsNode(object_value,'/PurchaseOrder/LineItems/LineItem[Part/@Id="717951002372"]') = 1
5 /
Explained.
Elapsed: 00:00:01.14
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 2571550067
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 116 | 93 (2)| 00:00:02 |
| 1 | SORT AGGREGATE | | 1 | 116 | | |
| 2 | NESTED LOOPS | | 25 | 2900 | 93 (2)| 00:00:02 |
| 3 | SORT UNIQUE | | 25 | 1675 | 79 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | LINEITEM_DATA | 25 | 1675 | 79 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | | 3 (0)| 00:00:01 |
|* 6 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 49 | 1 (0)| 00:00:01 |
|* 7 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("SYS_NC00011$"='717951002372')
5 - access("SYS_NC00011$"='717951002372')
6 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
stance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-propert
ies/><read-contents/></privilege>''))=1)
7 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
26 rows selected.
Elapsed: 00:00:03.12
SQL> select count(*)
2 from purchaseorder
3 where existsNode(object_value,'/PurchaseOrder/LineItems/LineItem[Part/@Id="717951002372"]') = 1
4 /
COUNT(*)
33
1 row selected.
Elapsed: 00:00:04.63
SQL> select count(*)
2 from purchaseorder,
3 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
4 where existsNode(value(l),'/LineItem[Part/@Id="717951002372"]') = 1
5 /
COUNT(*)
33
1 row selected.
Elapsed: 00:00:00.32
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 2571550067
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 116 | 93 (2)| 00:00:02 |
| 1 | SORT AGGREGATE | | 1 | 116 | | |
| 2 | NESTED LOOPS | | 25 | 2900 | 93 (2)| 00:00:02 |
| 3 | SORT UNIQUE | | 25 | 1675 | 79 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | LINEITEM_DATA | 25 | 1675 | 79 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | | 3 (0)| 00:00:01 |
|* 6 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 49 | 1 (0)| 00:00:01 |
|* 7 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("SYS_NC00011$"='717951002372')
5 - access("SYS_NC00011$"='717951002372')
6 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
stance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-propert
ies/><read-contents/></privilege>''))=1)
7 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
26 rows selected.
Elapsed: 00:00:00.04
SQL> explain plan for
2 select extractValue(object_value,'/PurchaseOrder/Reference')
3 from purchaseorder,
4 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
5 where existsNode(value(l),'/LineItem[Part/@Id="717951002372"]') = 1
6 /
Explained.
Elapsed: 00:00:00.07
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 713363872
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 25 | 8000 | 104 (0)| 00:00:02 |
| 1 | NESTED LOOPS | | 25 | 8000 | 104 (0)| 00:00:02 |
|* 2 | INDEX UNIQUE SCAN | LINEITEM_DATA | 25 | 1675 | 79 (0)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | | 3 (0)| 00:00:01 |
|* 4 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 253 | 1 (0)| 00:00:01 |
|* 5 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("SYS_NC00011$"='717951002372')
3 - access("SYS_NC00011$"='717951002372')
4 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-i
nstance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-proper
ties/><read-contents/></privilege>''))=1)
5 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
24 rows selected.
Elapsed: 00:00:00.04
SQL> select extractValue(object_value,'/PurchaseOrder/Reference')
2 from purchaseorder,
3 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
4 where existsNode(value(l),'/LineItem[Part/@Id="717951002372"]') = 1
5 /
EXTRACTVALUE(OBJECT_VALUE,'/PU
MWEISS-20030616154327385GMT
NSARCHAN-20030703170041824GMT
HBAER-20030206173836987GMT
LOZER-20031110131149107GMT
WTAYLOR-20030120174534374GMT
MHARTSTE-20031103172937613GMT
KGEE-20030919215826550GMT
PSULLY-20030712141634504GMT
JPATEL-20030630175356693GMT
RMATOS-2003072920455000GMT
DRAPHEAL-20030528180033254GMT
JRUSSEL-20031121213026539GMT
PTUCKER-20030918160532301GMT
SVOLLMAN-20031027120838903GMT
WGIETZ-20030208185026303GMT
TFOX-20030110164614994GMT
JPATEL-20030304214301386GMT
GGEONI-20030606135257846GMT
STOBIAS-20030817120358785GMT
COLSEN-20030525200717658GMT
SBAIDA-20030224182546606GMT
IMIKKILI-20030118180347537GMT
ABULL-20030429162730766GMT
NSARCHAN-20031113183134873GMT
LBISSOT-20030809134114505GMT
JKING-20030420162058859GMT
JMALLIN-20030506152048261GMT
AFRIPP-20030311153808601GMT
SHIGGINS-20030831151756257GMT
DBERNSTE-20030626122725631GMT
KPARTNER-20031021160248962GMT
ABANDA-2003062721524842GMT
DOCONNEL-20030904214708637GMT
33 rows selected.
Elapsed: 00:00:00.07
SQL> explain plan for
2 select extractValue(object_value,'/PurchaseOrder/Reference')
3 from purchaseorder
4 where existsNode
5 (
6 object_value,
7 '/PurchaseOrder/LineItems/LineItem/Part[@Id="717951002372"]'
8 ) = 1
9 /
Explained.
Elapsed: 00:00:00.02
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 849879259
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 25 | 8000 | 93 (2)| 00:00:02 |
| 1 | NESTED LOOPS | | 25 | 8000 | 93 (2)| 00:00:02 |
| 2 | SORT UNIQUE | | 25 | 1675 | 79 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN | LINEITEM_DATA | 25 | 1675 | 79 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | | 3 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 253 | 1 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("SYS_NC00011$"='717951002372')
4 - access("SYS_NC00011$"='717951002372')
5 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-i
nstance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-proper
ties/><read-contents/></privilege>''))=1)
6 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
25 rows selected.
Elapsed: 00:00:00.03
SQL> select extractValue(object_value,'/PurchaseOrder/Reference')
2 from purchaseorder
3 where existsNode
4 (
5 object_value,
6 '/PurchaseOrder/LineItems/LineItem/Part[@Id="717951002372"]'
7 ) = 1
8 /
EXTRACTVALUE(OBJECT_VALUE,'/PU
MWEISS-20030616154327385GMT
NSARCHAN-20030703170041824GMT
HBAER-20030206173836987GMT
LOZER-20031110131149107GMT
WTAYLOR-20030120174534374GMT
MHARTSTE-20031103172937613GMT
KGEE-20030919215826550GMT
PSULLY-20030712141634504GMT
JPATEL-20030630175356693GMT
RMATOS-2003072920455000GMT
DRAPHEAL-20030528180033254GMT
JRUSSEL-20031121213026539GMT
PTUCKER-20030918160532301GMT
SVOLLMAN-20031027120838903GMT
WGIETZ-20030208185026303GMT
TFOX-20030110164614994GMT
JPATEL-20030304214301386GMT
GGEONI-20030606135257846GMT
STOBIAS-20030817120358785GMT
COLSEN-20030525200717658GMT
SBAIDA-20030224182546606GMT
IMIKKILI-20030118180347537GMT
ABULL-20030429162730766GMT
NSARCHAN-20031113183134873GMT
LBISSOT-20030809134114505GMT
JKING-20030420162058859GMT
JMALLIN-20030506152048261GMT
AFRIPP-20030311153808601GMT
SHIGGINS-20030831151756257GMT
DBERNSTE-20030626122725631GMT
KPARTNER-20031021160248962GMT
ABANDA-2003062721524842GMT
DOCONNEL-20030904214708637GMT
33 rows selected.
Elapsed: 00:00:00.04
SQL> alter session set events ='19027 trace name context forever, level 0x800000'
2 /
Session altered.
Elapsed: 00:00:00.00
SQL> explain plan for
2 select count(*)
3 from purchaseorder
4 where existsNode(object_value,'/PurchaseOrder/LineItems/LineItem[Part/@Id="717951002372"]') = 1
5 /
Explained.
Elapsed: 00:00:00.03
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 3049344732
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 69 | 17 (6)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 69 | | |
| 2 | NESTED LOOPS | | 25 | 1725 | 17 (6)| 00:00:01 |
| 3 | SORT UNIQUE | | 25 | 750 | 3 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | 750 | 3 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 39 | 1 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("SYS_NC00011$"='717951002372')
5 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
stance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-propert
ies/><read-contents/></privilege>''))=1)
6 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
24 rows selected.
Elapsed: 00:00:00.03
SQL> select count(*)
2 from purchaseorder
3 where existsNode(object_value,'/PurchaseOrder/LineItems/LineItem[Part/@Id="717951002372"]') = 1
4 /
COUNT(*)
33
1 row selected.
Elapsed: 00:00:00.01
SQL> select count(*)
2 from purchaseorder,
3 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
4 where existsNode(value(l),'/LineItem[Part/@Id="717951002372"]') = 1
5 /
COUNT(*)
33
1 row selected.
Elapsed: 00:00:00.01
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 3049344732
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 69 | 17 (6)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 69 | | |
| 2 | NESTED LOOPS | | 25 | 1725 | 17 (6)| 00:00:01 |
| 3 | SORT UNIQUE | | 25 | 750 | 3 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | 750 | 3 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 39 | 1 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("SYS_NC00011$"='717951002372')
5 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
stance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-propert
ies/><read-contents/></privilege>''))=1)
6 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
24 rows selected.
Elapsed: 00:00:00.03
SQL> explain plan for
2 select extractValue(object_value,'/PurchaseOrder/Reference')
3 from purchaseorder,
4 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
5 where existsNode(value(l),'/LineItem[Part/@Id="717951002372"]') = 1
6 /
Explained.
Elapsed: 00:00:00.06
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 1516269755
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 25 | 2450 | 28 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | 25 | 2450 | 28 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | 750 | 3 (0)| 00:00:01 |
|* 3 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 68 | 1 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("SYS_NC00011$"='717951002372')
3 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-i
nstance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-proper
ties/><read-contents/></privilege>''))=1)
4 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
22 rows selected.
Elapsed: 00:00:00.04
SQL> select extractValue(object_value,'/PurchaseOrder/Reference')
2 from purchaseorder,
3 table (xmlsequence(extract(object_value,'/PurchaseOrder/LineItems/LineItem'))) l
4 where existsNode(value(l),'/LineItem[Part/@Id="717951002372"]') = 1
5 /
EXTRACTVALUE(OBJECT_VALUE,'/PU
MWEISS-20030616154327385GMT
NSARCHAN-20030703170041824GMT
HBAER-20030206173836987GMT
LOZER-20031110131149107GMT
WTAYLOR-20030120174534374GMT
MHARTSTE-20031103172937613GMT
KGEE-20030919215826550GMT
PSULLY-20030712141634504GMT
JPATEL-20030630175356693GMT
RMATOS-2003072920455000GMT
DRAPHEAL-20030528180033254GMT
JRUSSEL-20031121213026539GMT
PTUCKER-20030918160532301GMT
SVOLLMAN-20031027120838903GMT
WGIETZ-20030208185026303GMT
TFOX-20030110164614994GMT
JPATEL-20030304214301386GMT
GGEONI-20030606135257846GMT
STOBIAS-20030817120358785GMT
COLSEN-20030525200717658GMT
SBAIDA-20030224182546606GMT
IMIKKILI-20030118180347537GMT
ABULL-20030429162730766GMT
NSARCHAN-20031113183134873GMT
LBISSOT-20030809134114505GMT
JKING-20030420162058859GMT
JMALLIN-20030506152048261GMT
AFRIPP-20030311153808601GMT
SHIGGINS-20030831151756257GMT
DBERNSTE-20030626122725631GMT
KPARTNER-20031021160248962GMT
ABANDA-2003062721524842GMT
DOCONNEL-20030904214708637GMT
33 rows selected.
Elapsed: 00:00:00.01
SQL> explain plan for
2 select extractValue(object_value,'/PurchaseOrder/Reference')
3 from purchaseorder
4 where existsNode
5 (
6 object_value,
7 '/PurchaseOrder/LineItems/LineItem/Part[@Id="717951002372"]'
8 ) = 1
9 /
Explained.
Elapsed: 00:00:00.03
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 1197255270
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 25 | 2450 | 17 (6)| 00:00:01 |
| 1 | NESTED LOOPS | | 25 | 2450 | 17 (6)| 00:00:01 |
| 2 | SORT UNIQUE | | 25 | 750 | 3 (0)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | IPARTNUMBERINDEX | 25 | 750 | 3 (0)| 00:00:01 |
|* 4 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 68 | 1 (0)| 00:00:01 |
|* 5 | INDEX UNIQUE SCAN | LINEITEM_LIST | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("SYS_NC00011$"='717951002372')
4 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype(''<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-i
nstance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-proper
ties/><read-contents/></privilege>''))=1)
5 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003400035$")
23 rows selected.
Elapsed: 00:00:00.03
SQL> select extractValue(object_value,'/PurchaseOrder/Reference')
2 from purchaseorder
3 where existsNode
4 (
5 object_value,
6 '/PurchaseOrder/LineItems/LineItem/Part[@Id="717951002372"]'
7 ) = 1
8 /
EXTRACTVALUE(OBJECT_VALUE,'/PU
MWEISS-20030616154327385GMT
NSARCHAN-20030703170041824GMT
HBAER-20030206173836987GMT
LOZER-20031110131149107GMT
WTAYLOR-20030120174534374GMT
MHARTSTE-20031103172937613GMT
KGEE-20030919215826550GMT
PSULLY-20030712141634504GMT
JPATEL-20030630175356693GMT
RMATOS-2003072920455000GMT
DRAPHEAL-20030528180033254GMT
JRUSSEL-20031121213026539GMT
PTUCKER-20030918160532301GMT
SVOLLMAN-20031027120838903GMT
WGIETZ-20030208185026303GMT
TFOX-20030110164614994GMT
JPATEL-20030304214301386GMT
GGEONI-20030606135257846GMT
STOBIAS-20030817120358785GMT
COLSEN-20030525200717658GMT
SBAIDA-20030224182546606GMT
IMIKKILI-20030118180347537GMT
ABULL-20030429162730766GMT
NSARCHAN-20031113183134873GMT
LBISSOT-20030809134114505GMT
JKING-20030420162058859GMT
JMALLIN-20030506152048261GMT
AFRIPP-20030311153808601GMT
SHIGGINS-20030831151756257GMT
DBERNSTE-20030626122725631GMT
KPARTNER-20031021160248962GMT
ABANDA-2003062721524842GMT
DOCONNEL-20030904214708637GMT
33 rows selected.
Elapsed: 00:00:00.03
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options -
Problem in creating XMLTYPE table using schema validation
Hi All,
While executing the follwing script there is an error :
Script : " CREATE TABLE FINAPI_ONLINE_SEC_LOGIN_TMP1 OF
SYS.XMLTYPE XMLSCHEMA
"http://www.finnone.com/xsd/TransactionDataRequest.xsd"
ELEMENT "transactiondatarequest"
Error is :
ERROR at line 1:
"ORA-31000: Resource 'http://www.finnone.com/xsd/BaseSchema.xsd' is not an XDB schema document"
why this problem is coming though transactiondatarequest.xsd is reguisterd
Regards,
Vikas KumarCheck with XMLSpy, JDeveloper or for instance use http://tools.decisionsoft.com/schemaValidate/
Some pointers to start:
SQL> conn marco/marco
Connected.
SQL> select * from session_roles;
-- Quick and Dirty: grant xdbadmin, dba to marco
ROLE
XDB_WEBSERVICES
XDB_WEBSERVICES_WITH_PUBLIC
XDB_WEBSERVICES_OVER_HTTP
DBA
SELECT_CATALOG_ROLE
HS_ADMIN_ROLE
EXECUTE_CATALOG_ROLE
DELETE_CATALOG_ROLE
EXP_FULL_DATABASE
IMP_FULL_DATABASE
DATAPUMP_EXP_FULL_DATABASE
ROLE
DATAPUMP_IMP_FULL_DATABASE
GATHER_SYSTEM_STATISTICS
SCHEDULER_ADMIN
WM_ADMIN_ROLE
JAVA_ADMIN
JAVA_DEPLOY
XDBADMIN
XDB_SET_INVOKER
OLAP_XS_ADMIN
OLAP_DBA
21 rows selected.
SQL> set pages 5000
SQL> set long 1000000000
SQL> set trimspool on
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> desc dba_xml_schemas
Name Null? Type
OWNER VARCHAR2(30)
SCHEMA_URL VARCHAR2(700)
LOCAL VARCHAR2(3)
SCHEMA SYS.XMLTYPE
INT_OBJNAME VARCHAR2(4000)
QUAL_SCHEMA_URL VARCHAR2(2839)
HIER_TYPE VARCHAR2(11)
BINARY VARCHAR2(3)
SCHEMA_ID RAW(16)
HIDDEN VARCHAR2(3)
SQL> select OWNER, SCHEMA_URL, BINARY
2 from dba_xml_schemas
3
SQL> col SCHEMA_URL for a80
SQL> set lines 200
SQL> select OWNER, SCHEMA_URL, BINARY
2 from dba_xml_schemas
3 ;
OWNER SCHEMA_URL BIN
XDB http://xmlns.oracle.com/xdb/XDBStandard.xsd NO
XDB http://xmlns.oracle.com/xdb/log/xdblog.xsd NO
XDB http://xmlns.oracle.com/xdb/log/ftplog.xsd NO
XDB http://xmlns.oracle.com/xdb/log/httplog.xsd NO
XDB http://www.w3.org/2001/xml.xsd NO
XDB http://xmlns.oracle.com/xdb/xmltr.xsd NO
XDB http://xmlns.oracle.com/xdb/XDBFolderListing.xsd NO
XDB http://www.w3.org/1999/xlink.xsd NO
XDB http://www.w3.org/1999/csx.xlink.xsd YES
XDB http://www.w3.org/2001/XInclude.xsd NO
XDB http://www.w3.org/2001/csx.XInclude.xsd YES
XDB http://xmlns.oracle.com/xdb/stats.xsd NO
XDB http://xmlns.oracle.com/xdb/xdbconfig.xsd YES
SYS kuscomm.xsd NO
SYS kusindxt.xsd NO
SYS kusindex.xsd NO
SYS kuscnstr.xsd NO
SYS kusrlsct.xsd NO
SYS kusrlsc.xsd NO
XDB http://xmlns.oracle.com/xdb/XDBSchema.xsd NO
XDB http://xmlns.oracle.com/xdb/XDBResource.xsd NO
XDB http://www.w3.org/2001/csx.xml.xsd YES
XDB http://xmlns.oracle.com/xdb/csx.xmltr.xsd YES
XDB http://xmlns.oracle.com/xdb/acl.xsd YES
XDB http://xmlns.oracle.com/xdb/dav.xsd YES
XDB http://xmlns.oracle.com/xdb/XDBResConfig.xsd YES
SYS kusrlsgt.xsd NO
SYS kustrigt.xsd NO
SYS kustrig.xsd NO
SYS kusviewt.xsd NO
SYS kusview.xsd NO
SYS kususert.xsd NO
SYS kususer.xsd NO
SYS http://xmlns.oracle.com/streams/schemas/lcr/streamslcr.xsd NO
SYS kusrlsg.xsd NO
SYS kusrlspt.xsd NO
SYS kusrlsp.xsd NO
SYS kusrolet.xsd NO
SYS kusrole.xsd NO
SYS kusseqt.xsd NO
SYS kusseq.xsd NO
SYS kussynt.xsd NO
SYS kussyn.xsd NO
SYS kustblst.xsd NO
SYS kustbls.xsd NO
SYS kustablt.xsd NO
SYS kustable.xsd NO
SYS kusclust.xsd NO
SYS kusclus.xsd NO
SYS kusctxt.xsd NO
SYS kusctx.xsd NO
SYS kusdblkt.xsd NO
SYS kusdblk.xsd NO
SYS kusfgat.xsd NO
SYS kusfga.xsd NO
SYS kusmvt.xsd NO
SYS kusmv.xsd NO
SYS kusmvlt.xsd NO
SYS kusmvl.xsd NO
SYS kusquet.xsd NO
SYS kusque.xsd NO
SYS kusquetbt.xsd NO
SYS kusquetb.xsd NO
ORDSYS http://xmlns.oracle.com/ord/meta/exif NO
ORDSYS http://xmlns.oracle.com/ord/dicom/rpdatatype_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/meta/ordimage NO
ORDSYS http://xmlns.oracle.com/ord/dicom/datatype_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/mddatatype_1_0 NO
XDB http://xmlns.oracle.com/xs/dataSecurity.xsd YES
XDB http://xmlns.oracle.com/xs/aclids.xsd NO
XDB http://xmlns.oracle.com/xs/principal.xsd YES
XDB http://xmlns.oracle.com/xs/roleset.xsd NO
XDB http://xmlns.oracle.com/xs/securityclass.xsd YES
ORDSYS http://xmlns.oracle.com/ord/meta/dicomImage NO
EXFSYS http://xmlns.oracle.com/rlmgr/rclsprop.xsd NO
EXFSYS http://xmlns.oracle.com/rlmgr/rulecond.xsd NO
ORDSYS http://xmlns.oracle.com/ord/meta/iptc NO
ORDSYS http://xmlns.oracle.com/ord/meta/xmp NO
ORDSYS http://xmlns.oracle.com/ord/dicom/anonymity_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/constraint_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/metadata_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/mapping_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/preference_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/privateDictionary_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/standardDictionary_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/orddicom_1_0 NO
ORDSYS http://xmlns.oracle.com/ord/dicom/UIDdefinition_1_0 NO
MDSYS http://www.w3.org/1999/xlink/xlinks.xsd NO
MDSYS http://www.opengis.net/gml/geometry.xsd NO
MDSYS http://www.opengis.net/gml/feature.xsd NO
MDSYS http://xmlns.oracle.com/spatial/georaster/georaster.xsd NO
91 rows selected.
SQL> set lines 80
SQL> desc path_view
Name Null? Type
PATH VARCHAR2(1024)
RES SYS.XMLTYPE(XMLSchema "http:
//xmlns.oracle.com/xdb/XDBRe
source.xsd" Element "Resourc
e")
LINK SYS.XMLTYPE
RESID RAW(16)
SQL> desc resource_view
Name Null? Type
RES SYS.XMLTYPE(XMLSchema "http:
//xmlns.oracle.com/xdb/XDBRe
source.xsd" Element "Resourc
e")
ANY_PATH VARCHAR2(4000)
RESID RAW(16)
SQL> select *
2 from path_view
3 where rownum <= 1;
PATH
RES
LINK
RESID
/OLAP_XDS
<Resource xmlns="http://xmlns.oracle.com/xdb/XDBResource.xsd">
<CreationDate>2007-10-29T14:59:01.968000</CreationDate>
<ModificationDate>2007-10-29T14:59:02.281000</ModificationDate>
<DisplayName>OLAP_XDS</DisplayName>
<Language>en-US</Language>
<CharacterSet>UTF-8</CharacterSet>
<ContentType>application/octet-stream</ContentType>
<RefCount>1</RefCount>
</Resource>
<LINK>
<ParentName>/</ParentName>
<ChildName>OLAP_XDS</ChildName>
<Name>OLAP_XDS</Name>
<Flags>AAAABA==
</Flags>
<ParentOid>C4LJcGdKQ3+9zJ4w9efpxQ==
</ParentOid>
<ChildOid>8yNpXjvxQJeoruzx3GXRlQ==
</ChildOid>
<LinkType>Hard</LinkType>
</LINK>
F323695E3BF14097A8AEECF1DC65D195
SQL> select *
2 from resource_view
3 where rownum <= 1;
RES
ANY_PATH
RESID
<Resource xmlns="http://xmlns.oracle.com/xdb/XDBResource.xsd">
<CreationDate>2007-10-29T14:59:01.968000</CreationDate>
<ModificationDate>2007-10-29T14:59:02.281000</ModificationDate>
<DisplayName>OLAP_XDS</DisplayName>
<Language>en-US</Language>
<CharacterSet>UTF-8</CharacterSet>
<ContentType>application/octet-stream</ContentType>
<RefCount>1</RefCount>
</Resource>
/OLAP_XDS
F323695E3BF14097A8AEECF1DC65D195
SQL> select any_path from resource_view
2 where any_path like '%xsd%';
ANY_PATH
/public/root.xsd
/sys/schemas/PUBLIC/www.opengis.net/gml/feature.xsd
/sys/schemas/PUBLIC/www.opengis.net/gml/geometry.xsd
SQL> select xdbURIType ('/public/root.xsd').getClob() from dual;
XDBURITYPE('/PUBLIC/ROOT.XSD').GETCLOB()
<?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:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
<xs:annotation>
<xs:documentation>Example XML Schema</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
<xs:element ref="INFO"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="INFO" xdb:defaultTable="INFO_TABLE" xdb:SQLName="INFO_TYPE">
<xs:complexType>
<xs:sequence>
<xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
<xs:element name="INFO_CONTENT" xdb:SQLType="CLOB"
xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
SQL> select s.xmldata.schema_owner, s.xmldata.schema_url, s.xmldata.TARGET_NAMESPACE
2 from xdb.xdb$schema s
3 where rownum < 5;
XMLDATA.SCHEMA_OWNER
XMLDATA.SCHEMA_URL
XMLDATA.TARGET_NAMESPACE
XDB
http://xmlns.oracle.com/xdb/XDBStandard.xsd
http://xmlns.oracle.com/xdb/XDBStandard
XDB
http://xmlns.oracle.com/xdb/log/xdblog.xsd
http://xmlns.oracle.com/xdb/log
XDB
http://xmlns.oracle.com/xdb/log/ftplog.xsd
http://xmlns.oracle.com/xdb/log
XDB
http://xmlns.oracle.com/xdb/log/httplog.xsd
http://xmlns.oracle.com/xdb/log
4 rows selected.
-- Author : Mark Drake
-- Purpose : Compiling XML Schema
-- Altered : Marco Gralike
-- Date : 09/02/2007
-- Alteration : Different, simplified error handling
-- URL : http://www.liberidu.com/blog/?p=57
SET echo ON
-- spool compileSchemas.log
-- connect &USERNAME/&PASSWORD
-- set serveroutput on
declare
cursor getSchemaList IS
SELECT schema_url
FROM user_xml_schemas;
begin
FOR schema IN getSchemaList
loop
begin
dbms_output.put_line('Processing : ' || schema.schema_url);
dbms_xmlschema.compileSchema(schema.schema_url);
dbms_output.put_line('Compiled');
exception when others then
dbms_output.put_line('Failed ('||SQLCODE||'): ' ||SQLERRM);
end;
end loop;
end;
-- --------------------------------------------------------etc, etc, etc.
By the way IMHO there are no stupid questions, only stupid answer, and the learning curve on XMLDB is steep, so if I sometimes look back on my answers...
Message was edited by:
Marco Gralike -
ORA-31061 error while creating XMLType table with virtual column
I'm not calling it frustration ;)
but still... what about this one :
SQL> select * from v$version;
BANNER
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL> create table test_virtual of xmltype
2 xmltype store as binary xml
3 virtual columns (
4 doc_id as (
5 xmlcast(
6 xmlquery('/root/@id'
7 passing object_value returning content)
8 as number
9 )
10 )
11 )
12 ;
Table created.Now, on the latest version :
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL> create table test_virtual of xmltype
2 xmltype store as binary xml
3 virtual columns (
4 doc_id as (
5 xmlcast(
6 xmlquery('/root/@id'
7 passing object_value returning content)
8 as number
9 )
10 )
11 )
12 ;
passing object_value returning content)
ERROR at line 7:
ORA-00604: error occurred at recursive SQL level 1
ORA-31061: XDB error: dbms_xdbutil_int.get_tablespace_tab
ORA-06512: at "XDB.DBMS_XDBUTIL_INT", line 1002Is there something I should be aware of?
Right now, I'm just evaluating the version so I can't submit any SR.
Thanks for anyone trying to reproduce the issue.Just tested again on a new installation (64-bit server).
It works :
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL>
SQL> create table test_virtual of xmltype
2 xmltype store as binary xml
3 virtual columns (
4 doc_id as (
5 xmlcast(
6 xmlquery('/root/@id'
7 passing object_value returning content)
8 as number
9 )
10 )
11 );
Table created
Now I'll try to see what are the differences between the two installations.
Thanks Dan and Marco for looking into this.
Edited by: odie_63 on 2 mai 2012 15:51 -
Adding a row to a table with a button
Good day all;
I think I have now lost it... ;>))
LifeCycle Designer 8.05
Anyway, If the user of the form requires additional rows to enter infoamtion, I want them to be able to add a row using a button. I have tried using the following
Table"N".Row2.instanceManager.addInstance(1); ="N" is the table name.
I have done this on a couple of other forms but I must be missing something as I am geting the following error in the java Consol
"GeneralError: Operation failed.
XFAObject.addInstance:1:XFA:form1[0]:#subform[0]:#subform[1]:Button1[0]:click
The element [max] has violated its allowable number of occurrences."
The form is saves as a Arcobat 8 Dynamic XML form
I
Page 1 is flowed
Subform is flowed
Would someone be so kind as to point me in the right direction.
Thanks all
ChompThanks Radzmar;
You were correct.... It appears I was only looking at the bindings for the damn table not the row.......
Thanks again -
Replication on the table with XMLType column and schema registered
Dear All,
Does Oracle XML DB 11g support replication for tables with schema registered?
Is there any recommended approach?
Thanks and regards,
SwapnilHmmmm ... I don't know if I should smile or frown with the implication that I am an OO guy :D :D
Most of my colleagues when I started working as a software engineer, treated me as too low-level because of my C background (started doing C in 1985).
In my last job, my colleagues hated my guts because I was asking them to squeeze every bit of performance out of C++ by using STL which is definitely not OO (although C++ is).
My current colleagues treat me as a DB guru (which I most definitely am not) and they overlook/forget the fact that most of them use Java libraries in their projects, that I wrote for them !
I am inclined to believe that I do not fall into any category in the end...
The only thing I am for sure - and I am proud of it - is inquisitive. I want to know everything there is about the tools I use, and so I end up spending hours and hours investigating... (Microsoft found that out the hard way when I filed 16 bug reports in 8 days when Visual C++ 6 came out ! Not that it hurt them though...)
This is where my confession ends (and my working on the XML validator starts...)
Καληνύχτα Marco
Philip (Φίλιππος in Greek)
PS: I did not follow the last solution anyway. I just wanted to verify its operability ;) -
Indices and constraints on XML Tables/Columns (with Schema)
Hi,
I've read a lot of documents by know, but the more I read the more I got confused. So I hope you can help me.
Frist my Oracle Server Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
I've manages to create a table with a column with the type SYS.XMLTYPE and the storage modle "Object Relational" with an XML Schema.
I can insert data and I can execute XQuery statements.
I can also create an XMLTYPE table with my Schema, althoug the tool SQL Developer keeps telling me, that the one column wich is generated within the table is of the type CLOB instead of object realtional (which is what I defined).
The query for that is:
CREATE TABLE ENTRY_XML OF XMLTYPE
XMLTYPE STORE AS OBJECT RELATIONAL
XMLSCHEMA "BBMRI_Entry.xsd" ELEMENT "Entry";
That's where I am, now my questions:
1. What's the difference? I'm aware of the obviouse difference, that with the first way I can add relational columns as well, but apart from that? If I only want to store the xml data, is the second approach always better (especially in regard to my next question)?
2. My schema contains elements with attributes (which contain IDs), which have to be unique. So I tried to add a UNIQUE constraint, but failed. I found this (http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/constraints/Specify_Constraints.html), but it just doesn't work.
Query: "ALTER TABLE ENTRY_XML CONSTRAINT ENTRY_XML_SUBID_UNQIUE UNIQUE (xmldata."SubId");"
Error: "ORA-01735: invalid ALTER TABLE option"
3. I didn't try yet, but I need to specifiy foreign keys within the XML as well (which is explained in the link at question 2). I guess the solution to question 2 will make this possible as well.
4. Since I can create a UNIQUE constaint for attributes (well, I can't yet, but I hope that this will change soon) I woundered if it would be possible to realize something like auto_increment. Although I see the problem with validating the xml input if the Ids are empty. Any suggestions on that problem? Do I have to query for the highest (free) id before I can insert the new documents?
Well, that's enough for today, I hope someone can help me!
Greetings, FlorianI've read through all the literature (again) and found out, that I did most of the stuff right in the first place. I just missinterpreted the generated tables for the types and wondered why they only contained one column. Well, at least one mistery solved.
But know to make it easier just one question, which might solve all problems I have:
How can I create UNIQUE constraints and FOREIGN KEYS when I have a table or column of the type XmlType with a schema using the object relational storage method?
I found a solution http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb05sto.htm#i1042421 (Example 5-12), but it just does not work for me.
I removed the FOREIGN KEY and tried it again and the UNIQUE Key works.
So basically the question is how to retrieve the "AId" Attribute. "XMLDATA"."AId", "XMLDATA"."Attribute"."AId" and "XMLDATA"."Subject"."Attribute"."AId" all do not work.
I've added my schema declarations at the bottom (which I've already successfully registred and used without foreign keys and constraints, so they work).
After I've registered the two schema files 3 types and 11 tables where created. One type for the attribute, one for the study type and one probably to link the attributes to the study types. The tables are one for the attribute, 4 for the content*-elements, 2 for the study type (I don't really know why two) and 4 with strange names starting with "SYS_NT" and then some random numbers and letters (looks alot like some base64 encoded string).
The Query I try to use to create the table is: (The table "Attribute" already exists and contains a field "ID", which is it's PK.)
CREATE TABLE STUDYTYPE_XML
OF XMLType (UNIQUE ("XMLDATA"."STId"),
FOREIGN KEY ("XMLDATA"."AId") REFERENCES ATTRIBUTE(ID))
XMLTYPE STORE AS OBJECT RELATIONAL
ELEMENT "StudyType.xsd#StudyType";
The error I get is:
Error starting at line 1 in command:
CREATE TABLE STUDYTYPE_XML
OF XMLType (UNIQUE ("XMLDATA"."STId"),
FOREIGN KEY ("XMLDATA"."AId") REFERENCES ATTRIBUTE(ID))
ELEMENT "StudyType.xsd#StudyType"
Error at Command Line:3 Column:37
Error report:
SQL Error: ORA-22809: nonexistent attribute
22809. 00000 - "nonexistent attribute"
Cause: An attempt was made to access a non-existent attribute of an
object type.
Action: Check the attribute reference to see if it is valid. Then retry
the operation.
Attribute-Schema (Attribute.xsd):
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:attribute name="AId">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Name" type="xs:string" />
<xs:element name="ContentString" type="xs:string" />
<xs:element name="ContentInteger" type="xs:integer" />
<xs:element name="ContentDouble" type="xs:decimal" />
<xs:element name="ContentDate" type="xs:date" />
<xs:element name="Attribute">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element ref="ContentString" />
<xs:element ref="ContentInteger" />
<xs:element ref="ContentDouble" />
<xs:element ref="ContentDate" />
</xs:choice>
<xs:attribute ref="AId" use="required" />
<xs:attribute ref="Name" use="optional" />
</xs:complexType>
</xs:element>
</xs:schema>
Study Type Schema (StudyType.xsd):
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="Attribute.xsd" />
<xs:attribute name="STId">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:element name="StudyType">
<xs:complexType>
<xs:sequence>
<xs:element ref="Attribute" minOccurs="1" maxOccurs="unbounded" />
<xs:element ref="StudyType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute ref="STId" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
Edited by: alwaysspam on Sep 8, 2010 5:35 PM -
ORA-07445 in the alert log when inserting into table with XMLType column
I'm trying to insert an xml-document into a table with a schema-based XMLType column. When I try to insert a row (using plsql-developer) - oracle is busy for a few seconds and then the connection to oracle is lost.
Below you''ll find the following to recreate the problem:
a) contents from the alert log
b) create script for the table
c) the before-insert trigger
d) the xml-schema
e) code for registering the schema
f) the test program
g) platform information
Alert Log:
Fri Aug 17 00:44:11 2007
Errors in file /oracle/app/oracle/product/10.2.0/db_1/admin/dntspilot2/udump/dntspilot2_ora_13807.trc:
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [475177] [] [] []
Create script for the table:
CREATE TABLE "DNTSB"."SIGNATURETABLE"
( "XML_DOCUMENT" "SYS"."XMLTYPE" ,
"TS" TIMESTAMP (6) WITH TIME ZONE NOT NULL ENABLE
) XMLTYPE COLUMN "XML_DOCUMENT" XMLSCHEMA "http://www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd" ELEMENT "Object"
ROWDEPENDENCIES ;
Before-insert trigger:
create or replace trigger BIS_SIGNATURETABLE
before insert on signaturetable
for each row
declare
-- local variables here
l_sigtab_rec signaturetable%rowtype;
begin
if (:new.xml_document is not null) then
:new.xml_document.schemavalidate();
end if;
l_sigtab_rec.xml_document := :new.xml_document;
end BIS_SIGNATURETABLE2;
XML-Schema (xmldsig-core-schema.xsd):
=====================================================================================
<?xml version="1.0" encoding="utf-8"?>
<!-- Schema for XML Signatures
http://www.w3.org/2000/09/xmldsig#
$Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
Copyright 2001 The Internet Society and W3C (Massachusetts Institute
of Technology, Institut National de Recherche en Informatique et en
Automatique, Keio University). All Rights Reserved.
http://www.w3.org/Consortium/Legal/
This document is governed by the W3C Software License [1] as described
in the FAQ [2].
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xdb="http://xmlns.oracle.com/xdb"
targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1" elementFormDefault="qualified">
<!-- Basic Types Defined for Signatures -->
<xs:simpleType name="CryptoBinary">
<xs:restriction base="xs:base64Binary">
</xs:restriction>
</xs:simpleType>
<!-- Start Signature -->
<xs:element name="Signature" type="ds:SignatureType"/>
<xs:complexType name="SignatureType">
<xs:sequence>
<xs:element ref="ds:SignedInfo"/>
<xs:element ref="ds:SignatureValue"/>
<xs:element ref="ds:KeyInfo" minOccurs="0"/>
<xs:element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:complexType>
<xs:element name="SignatureValue" type="ds:SignatureValueType"/>
<xs:complexType name="SignatureValueType">
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- Start SignedInfo -->
<xs:element name="SignedInfo" type="ds:SignedInfoType"/>
<xs:complexType name="SignedInfoType">
<xs:sequence>
<xs:element ref="ds:CanonicalizationMethod"/>
<xs:element ref="ds:SignatureMethod"/>
<xs:element ref="ds:Reference" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:complexType>
<xs:element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
<xs:complexType name="CanonicalizationMethodType" mixed="true">
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) namespace -->
</xs:sequence>
<xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
</xs:complexType>
<xs:element name="SignatureMethod" type="ds:SignatureMethodType"/>
<xs:complexType name="SignatureMethodType" mixed="true">
<xs:sequence>
<xs:element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) external namespace -->
</xs:sequence>
<xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
</xs:complexType>
<!-- Start Reference -->
<xs:element name="Reference" type="ds:ReferenceType"/>
<xs:complexType name="ReferenceType">
<xs:sequence>
<xs:element ref="ds:Transforms" minOccurs="0"/>
<xs:element ref="ds:DigestMethod"/>
<xs:element ref="ds:DigestValue"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
<xs:attribute name="URI" type="xs:anyURI" use="optional"/>
<xs:attribute name="Type" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:element name="Transforms" type="ds:TransformsType"/>
<xs:complexType name="TransformsType">
<xs:sequence>
<xs:element ref="ds:Transform" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Transform" type="ds:TransformType"/>
<xs:complexType name="TransformType" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="##other" processContents="lax"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
<xs:element name="XPath" type="xs:string"/>
</xs:choice>
<xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
</xs:complexType>
<!-- End Reference -->
<xs:element name="DigestMethod" type="ds:DigestMethodType"/>
<xs:complexType name="DigestMethodType" mixed="true">
<xs:sequence>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
</xs:complexType>
<xs:element name="DigestValue" type="ds:DigestValueType"/>
<xs:simpleType name="DigestValueType">
<xs:restriction base="xs:base64Binary"/>
</xs:simpleType>
<!-- End SignedInfo -->
<!-- Start KeyInfo -->
<xs:element name="KeyInfo" type="ds:KeyInfoType"/>
<xs:complexType name="KeyInfoType" mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:element ref="ds:KeyName"/>
<xs:element ref="ds:KeyValue"/>
<xs:element ref="ds:RetrievalMethod"/>
<xs:element ref="ds:X509Data"/>
<xs:element ref="ds:PGPData"/>
<xs:element ref="ds:SPKIData"/>
<xs:element ref="ds:MgmtData"/>
<xs:any processContents="lax" namespace="##other"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
</xs:choice>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:complexType>
<xs:element name="KeyName" type="xs:string"/>
<xs:element name="MgmtData" type="xs:string"/>
<xs:element name="KeyValue" type="ds:KeyValueType"/>
<xs:complexType name="KeyValueType" mixed="true">
<xs:choice>
<xs:element ref="ds:DSAKeyValue"/>
<xs:element ref="ds:RSAKeyValue"/>
<xs:any namespace="##other" processContents="lax"/>
</xs:choice>
</xs:complexType>
<xs:element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
<xs:complexType name="RetrievalMethodType">
<xs:sequence>
<xs:element ref="ds:Transforms" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="URI" type="xs:anyURI"/>
<xs:attribute name="Type" type="xs:anyURI" use="optional"/>
</xs:complexType>
<!-- Start X509Data -->
<xs:element name="X509Data" type="ds:X509DataType"/>
<xs:complexType name="X509DataType">
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
<xs:element name="X509SKI" type="xs:base64Binary"/>
<xs:element name="X509SubjectName" type="xs:string"/>
<xs:element name="X509Certificate" type="xs:base64Binary"/>
<xs:element name="X509CRL" type="xs:base64Binary"/>
<xs:any namespace="##other" processContents="lax"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="X509IssuerSerialType">
<xs:sequence>
<xs:element name="X509IssuerName" type="xs:string"/>
<xs:element name="X509SerialNumber" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<!-- End X509Data -->
<!-- Begin PGPData -->
<xs:element name="PGPData" type="ds:PGPDataType"/>
<xs:complexType name="PGPDataType">
<xs:choice>
<xs:sequence>
<xs:element name="PGPKeyID" type="xs:base64Binary"/>
<xs:element name="PGPKeyPacket" type="xs:base64Binary" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:sequence>
<xs:element name="PGPKeyPacket" type="xs:base64Binary"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:choice>
</xs:complexType>
<!-- End PGPData -->
<!-- Begin SPKIData -->
<xs:element name="SPKIData" type="ds:SPKIDataType"/>
<xs:complexType name="SPKIDataType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="SPKISexp" type="xs:base64Binary"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- End SPKIData -->
<!-- End KeyInfo -->
<!-- Start Object (Manifest, SignatureProperty) -->
<xs:element name="Object" type="ds:ObjectType"/>
<xs:complexType name="ObjectType" mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="##any" processContents="lax"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
<xs:attribute name="MimeType" type="xs:string" use="optional"/> <!-- add a grep facet -->
<xs:attribute name="Encoding" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:element name="Manifest" type="ds:ManifestType"/>
<xs:complexType name="ManifestType">
<xs:sequence>
<xs:element ref="ds:Reference" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:complexType>
<xs:element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
<xs:complexType name="SignaturePropertiesType">
<xs:sequence>
<xs:element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:complexType>
<xs:element name="SignatureProperty" type="ds:SignaturePropertyType"/>
<xs:complexType name="SignaturePropertyType" mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:any namespace="##other" processContents="lax"/>
<!-- (1,1) elements from (1,unbounded) namespaces -->
</xs:choice>
<xs:attribute name="Target" type="xs:anyURI" use="required"/>
<xs:attribute name="Id" type="xs:ID" use="optional"/>
</xs:complexType>
<!-- End Object (Manifest, SignatureProperty) -->
<!-- Start Algorithm Parameters -->
<xs:simpleType name="HMACOutputLengthType">
<xs:restriction base="xs:integer"/>
</xs:simpleType>
<!-- Start KeyValue Element-types -->
<xs:element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
<xs:complexType name="DSAKeyValueType">
<xs:sequence>
<xs:sequence minOccurs="0">
<xs:element name="P" type="ds:CryptoBinary"/>
<xs:element name="Q" type="ds:CryptoBinary"/>
</xs:sequence>
<xs:element name="G" type="ds:CryptoBinary" minOccurs="0"/>
<xs:element name="Y" type="ds:CryptoBinary"/>
<xs:element name="J" type="ds:CryptoBinary" minOccurs="0"/>
<xs:sequence minOccurs="0">
<xs:element name="Seed" type="ds:CryptoBinary"/>
<xs:element name="PgenCounter" type="ds:CryptoBinary"/>
</xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
<xs:complexType name="RSAKeyValueType">
<xs:sequence>
<xs:element name="Modulus" type="ds:CryptoBinary"/>
<xs:element name="Exponent" type="ds:CryptoBinary"/>
</xs:sequence>
</xs:complexType>
<!-- End KeyValue Element-types -->
<!-- End Signature -->
</xs:schema>
===============================================================================
Code for registering the xml-schema
begin
dbms_xmlschema.deleteSchema('http://xmlns.oracle.com/xdb/schemas/DNTSB/www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd',
dbms_xmlschema.DELETE_CASCADE_FORCE);
end;
begin
DBMS_XMLSCHEMA.REGISTERURI(
schemaurl => 'http://www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd',
schemadocuri => 'http://www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd',
local => TRUE,
gentypes => TRUE,
genbean => FALSE,
gentables => TRUE,
force => FALSE,
owner => 'DNTSB',
options => 0);
end;
Test program
-- Created on 17-07-2006 by EEJ
declare
XML_TEXT3 CLOB := '<Object xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignatureProperties>
<SignatureProperty Target="">
<Timestamp xmlns="http://www.sporfori.fo/schemas/dnts/general/2006/11/14">2007-05-10T12:00:00-05:00</Timestamp>
</SignatureProperty>
</SignatureProperties>
</Object>';
xmldoc xmltype;
begin
xmldoc := xmltype(xml_text3);
insert into signaturetable
(xml_document, ts)
values
(xmldoc, current_timestamp);
end;
Platform information
Operating system:
-bash-3.00$ uname -a
SunOS dntsdb 5.10 Generic_125101-09 i86pc i386 i86pc
SQLPlus:
SQL*Plus: Release 10.2.0.3.0 - Production on Fri Aug 17 00:15:13 2007
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning and Data Mining options
Kind Regards,
EyðunYou should report this in a service request on http://metalink.oracle.com.
It is a shame that you put all the effort here to describe your problem, but on the other hand you can now also copy & paste the question to Oracle Support.
Because you are using 10.2.0.3; I am guessing that you have a valid service contract... -
Below mentioned is the schema-based xmltype table
CREATE TABLE BRSK.MEDV_brpubdoc_tab OF XMLType
XMLSCHEMA "http://xmlns.oracle.com/xdb/schemas/BRSK/www.medversation.com/brpubdoc/brpubdoc.xsd"
ELEMENT "brpubdoc"
TABLESPACE BRSK_M;
when ever delete the old schema and register the new schema should i drop the previous xmltype table and create the new one?If this is the case then we will be losing the previous xml contents.Is there is a way to avoid drop and creation on xmltype table on schema delete and schema registration.Please help me out on this.I hava gone through the below mentioned link http://download-east.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb07evo.htm which states In prior releases an XML schema, once registered with Oracle XML DB at a particular URL, could not be modified or evolved because there may be XMLType tables that depend on the XML schema. There was no standard procedure for schema evolution. This release supports XML schema evolution by providing a PL/SQL procedure CopyEvolve() a part of the DBMS_XMLSCHEMA package. CopyEvolve() involves copying existing instance documents to temporary tables, dropping and re-registering the XML schema, and copying the instance documents to the new XMLType tables.So i think schema evolution works in 10g only
-
How to improve performance of a query that is based on an xmltype table
Dear Friends,
I have a query that is pulling records from an xmltype table with 9000 rows and it is running very slow.
I am using XMLTABLE command to retreive the rows. It is taking upto 30 minutes to finish.
Would you be able to suggest how I can make it faster. Thanks.
Below is the query.....
INSERT INTO temp_sap_po_receipt_history_t
(po_number, po_line_number, doc_year,
material_doc, material_doc_item, quantity, sap_ref_doc_no_long,
reference_doc, movement_type_code,
sap_ref_doc_no, posting_date, entry_date, entry_time, hist_type)
SELECT :pin_po_number po_number,
b.po_line_number, b.doc_year,
b.material_doc, b.material_doc_item, b.quantity, b.sap_ref_doc_no_long,
b.reference_doc, b.movement_type_code,
b.sap_ref_doc_no, to_date(b.posting_date,'rrrr-mm-dd'),
to_date(b.entry_date,'rrrr-mm-dd'), b.entry_time, b.hist_type
FROM temp_xml t,
XMLTABLE(XMLNAMESPACES('urn:sap-com:document:sap:rfc:functions' AS "n0"),
'/n0:BAPI_PO_GETDETAIL1Response/POHISTORY/item'
PASSING t.object_value
COLUMNS PO_LINE_NUMBER VARCHAR2(20) PATH 'PO_ITEM',
DOC_YEAR varchar2(4) PATH 'DOC_YEAR',
MATERIAL_DOC varchar2(30) PATH 'MAT_DOC',
MATERIAL_DOC_ITEM VARCHAR2(10) PATH 'MATDOC_ITEM',
QUANTITY NUMBER(20,6) PATH 'QUANTITY',
SAP_REF_DOC_NO_LONG VARCHAR2(20) PATH 'REF_DOC_NO_LONG',
REFERENCE_DOC VARCHAR2(20) PATH 'REF_DOC',
MOVEMENT_TYPE_CODE VARCHAR2(4) PATH 'MOVE_TYPE',
SAP_REF_DOC_NO VARCHAR2(20) PATH 'REF_DOC_NO',
POSTING_DATE VARCHAR2(10) PATH 'PSTNG_DATE',
ENTRY_DATE VARCHAR2(10) PATH 'ENTRY_DATE',
ENTRY_TIME VARCHAR2(8) PATH 'ENTRY_TIME',
HIST_TYPE VARCHAR2(5) PATH 'HIST_TYPE') b;Based on response from mdrake on this thread:
Re: XML file processing into oracle
For large XML's, you can speed up the processing of XMLTABLE by using a registered schema...
declare
SCHEMAURL VARCHAR2(256) := 'http://xmlns.example.org/xsd/testcase.xsd';
XMLSCHEMA VARCHAR2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
<xs:element name="cust_order" type="cust_orderType" xdb:defaultTable="CUST_ORDER_TBL"/>
<xs:complexType name="groupType" xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="item" type="itemType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:byte" use="required"/>
</xs:complexType>
<xs:complexType name="itemType" xdb:maintainDOM="false">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="id" type="xs:short" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="cust_orderType" xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="group" type="groupType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="cust_id" type="xs:short" use="required"/>
</xs:complexType>
</xs:schema>';
INSTANCE CLOB :=
'<cust_order cust_id="12345">
<group id="1">
<item id="1" name="Standard Mouse">100</item>
<item id="2" name="Keyboard">100</item>
<item id="3" name="Memory Module 2Gb">200</item>
<item id="4" name="Processor 3Ghz">25</item>
<item id="5" name="Processor 2.4Ghz">75</item>
</group>
<group id="2">
<item id="1" name="Graphics Tablet">15</item>
<item id="2" name="Keyboard">15</item>
<item id="3" name="Memory Module 4Gb">15</item>
<item id="4" name="Processor Quad Core 2.8Ghz">15</item>
</group>
<group id="3">
<item id="1" name="Optical Mouse">5</item>
<item id="2" name="Ergo Keyboard">5</item>
<item id="3" name="Memory Module 2Gb">10</item>
<item id="4" name="Processor Dual Core 2.4Ghz">5</item>
<item id="5" name="Dual Output Graphics Card">5</item>
<item id="6" name="28inch LED Monitor">10</item>
<item id="7" name="Webcam">5</item>
<item id="8" name="A3 1200dpi Laser Printer">2</item>
</group>
</cust_order>';
begin
dbms_xmlschema.registerSchema
schemaurl => SCHEMAURL
,schemadoc => XMLSCHEMA
,local => TRUE
,genTypes => TRUE
,genBean => FALSE
,genTables => TRUE
,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
execute immediate 'insert into CUST_ORDER_TBL values (XMLTYPE(:INSTANCE))' using INSTANCE;
end;
SQL> desc CUST_ORDER_TBL
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.org/xsd/testcase.xsd" Element "cust_order") STORAGE Object-relational TYPE "cust_orderType222_T"
SQL> set autotrace on explain
SQL> set pages 60 lines 164 heading on
SQL> col cust_id format a8
SQL> select extract(object_value,'/cust_order/@cust_id') as cust_id
2 ,grp.id as group_id, itm.id as item_id, itm.inm as item_name, itm.qty as item_qty
3 from CUST_ORDER_TBL
4 ,XMLTABLE('/cust_order/group'
5 passing object_value
6 columns id number path '@id'
7 ,item xmltype path 'item'
8 ) grp
9 ,XMLTABLE('/item'
10 passing grp.item
11 columns id number path '@id'
12 ,inm varchar2(30) path '@name'
13 ,qty number path '.'
14 ) itm
15 /
CUST_ID GROUP_ID ITEM_ID ITEM_NAME ITEM_QTY
12345 1 1 Standard Mouse 100
12345 1 2 Keyboard 100
12345 1 3 Memory Module 2Gb 200
12345 1 4 Processor 3Ghz 25
12345 1 5 Processor 2.4Ghz 75
12345 2 1 Graphics Tablet 15
12345 2 2 Keyboard 15
12345 2 3 Memory Module 4Gb 15
12345 2 4 Processor Quad Core 2.8Ghz 15
12345 3 1 Optical Mouse 5
12345 3 2 Ergo Keyboard 5
12345 3 3 Memory Module 2Gb 10
12345 3 4 Processor Dual Core 2.4Ghz 5
12345 3 5 Dual Output Graphics Card 5
12345 3 6 28inch LED Monitor 10
12345 3 7 Webcam 5
12345 3 8 A3 1200dpi Laser Printer 2
17 rows selected.Need at least 10.2.0.3 for performance i.e. to avoid COLLECTION ITERATOR PICKLER FETCH in execution plan...
On 10.2.0.1:
Execution Plan
Plan hash value: 3741473841
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 24504 | 89M| 873 (1)| 00:00:11 |
| 1 | NESTED LOOPS | | 24504 | 89M| 873 (1)| 00:00:11 |
| 2 | NESTED LOOPS | | 3 | 11460 | 805 (1)| 00:00:10 |
| 3 | TABLE ACCESS FULL | CUST_ORDER_TBL | 1 | 3777 | 3 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN | SYS_IOT_TOP_774117 | 3 | 129 | 1 (0)| 00:00:01 |
| 5 | COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE | | | | |
Predicate Information (identified by operation id):
4 - access("NESTED_TABLE_ID"="CUST_ORDER_TBL"."SYS_NC0000900010$")
filter("SYS_NC_TYPEID$" IS NOT NULL)
Note
- dynamic sampling used for this statementOn 10.2.0.3:
Execution Plan
Plan hash value: 1048233240
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 17 | 132K| 839 (0)| 00:00:11 |
| 1 | NESTED LOOPS | | 17 | 132K| 839 (0)| 00:00:11 |
| 2 | MERGE JOIN CARTESIAN | | 17 | 131K| 805 (0)| 00:00:10 |
| 3 | TABLE ACCESS FULL | CUST_ORDER_TBL | 1 | 3781 | 3 (0)| 00:00:01 |
| 4 | BUFFER SORT | | 17 | 70839 | 802 (0)| 00:00:10 |
|* 5 | INDEX FAST FULL SCAN| SYS_IOT_TOP_56154 | 17 | 70839 | 802 (0)| 00:00:10 |
|* 6 | INDEX UNIQUE SCAN | SYS_IOT_TOP_56152 | 1 | 43 | 2 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | SYS_C006701 | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
5 - filter("SYS_NC_TYPEID$" IS NOT NULL)
6 - access("SYS_NTpzENS1H/RwSSC7TVzvlqmQ=="."NESTED_TABLE_ID"="SYS_NTnN5b8Q+8Txi9V
w5Ysl6x9w=="."SYS_NC0000600007$")
filter("SYS_NC_TYPEID$" IS NOT NULL AND
"NESTED_TABLE_ID"="CUST_ORDER_TBL"."SYS_NC0000900010$")
7 - access("SYS_NTpzENS1H/RwSSC7TVzvlqmQ=="."NESTED_TABLE_ID"="SYS_NTnN5b8Q+8Txi9V
w5Ysl6x9w=="."SYS_NC0000600007$")
Note
- dynamic sampling used for this statement----------------------------------------------------------------------------------------------------------
-- CLEAN UP
DROP TABLE CUST_ORDER_TBL purge;
exec dbms_xmlschema.deleteschema('http://xmlns.example.org/xsd/testcase.xsd'); -
HI Gentlemen,
Given a schema-based XMLTYPE table with one big XML instance stored in it. I would like to select a subtree like <gnr V="12345" ...> ... </gnr> where the attribute could be a bind parameter dynamically changing. As an output I would like to have the whole subtree with XML tags, for which I already have a perfectly good XSL stylesheet to display contents. It is working well when the subtree is stored in an .xml file which references the .xsl stylesheet. My question is: How can I organize that the ADF view is connected to the stylesheet and how can I apply all that to a .jspx ADF page? Updating the table is not a matter. Please help if you can.
Thanks, regards
Miklos HERBOLYIf you already have the correct xsl file to use, you might consider creating a xsql page instead of a jspx page:
http://people.cis.ksu.edu/~hankley/d764/tut05/Kamath_XSQL.html
NA
http://nickaiva.blogspot.com
Maybe you are looking for
-
URGENT! I need help on LDAP - Finding deleted users Attribute "sAMAccount"
Hi, I am trying to get deleted users from Active Directory after a certain interval. Every time only the differences in the result will be shown. Also I need to get the value of the specific attribute called "sAMAccount" every time for each user(in t
-
What size screw driver do i need to install RAM?
I need to install 512 more mb of ram for my ibook and the compartment under the keyboard is teeny-tiny. Since i'm going to the home depot, what size screwdriver do i need to unscrew the compartment to get to the ram
-
UIX tree, table-based example needed
Has anyone ever used the UIX tree element (JDev help, UIX developer's guide, chapter 15) in combination with BC4J and/or Jheadstart generated UIX-pages? Any examples are welcome. I also can't get the (static :-/) example in the Help to expand when cl
-
Hi All, I am new to JSP. Please send me a JSP Login Form Validatio with DB. Regards, Gokul.
-
How to get into sub forum to get reader for 5.1 ios
How to get reader for5.1 ios