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?
-Srini

You 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

Similar Messages

  • XML Schema based XMLType column leaves file open on error

    Hello,
    I have the following situation on both oracle 10.1.0.2.0 and 10.1.0.4.0:
    insert into xml_products (xmlfile) values(bfilename(file_loc, char_id));
    "xmlfile" is a xmltype column based on a registered xml schema.
    When the file fails xml schema validation, the file remains open and I cannot move it until i close the session.
    Is this a bug or an "intentional feature"?
    Any workarounds?
    Thanks,
    Flavio

    All right Mark,
    thanks for your reply.
    Meanwhile I fixed the problem and posted my workaround here:
    http://oraclequirks.blogspot.com/2005/11/ora-29292-and-xmltype.html
    Bye,
    Flavio

  • ExistsNode exception with Schema based XMLType table

    hi,
    While running this query on structured table -->
    SELECT OBJECT_VALUE
    FROM Table_Structured
    WHERE existsNode(OBJECT_VALUE, '/Entity/Fields[field2="stringvalue"]') = 1;
    I get this exception -->
    Error report:
    SQL Error: ORA-00932: inconsistent datatypes: expected UDT got CHAR
    00932. 00000 - "inconsistent datatypes: expected %s got %s"
    *Cause:   
    *Action:
    There is no problem running this on unstructured XMLType tables
    What the problem ?
    Thanks in advance.

    To get an answer more meaningful than the one the error message gives you (and that's pretty clear as XML errors go), you're going to need to supply a bit more info. At least the relevant portion of the schema and the actual definition of the table. The database version never hurts either.
    Chris

  • 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?

  • Can't insert schema-based xmltype into binary xmltype table

    I'm having issues trying to use binary storage along with the ALLOW ANYSCHEMA clause. I can't use the XMLSchema-instance mechanism for creating my schema-based XMLType instances, so I'm using CreateSchemaBasedXml. When I try to insert the XMLType into the table, however, it seems to think it's not schema-based and throws an error. I trimmed down my schema for the purposes of this example. Here's the schema (schematest.xsd):
    <?xml version="1.0" encoding="Windows-1252"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="FORMINFO">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="SUBJECT">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="ADDR">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="STREET" type="xs:string" />
                        <xs:element name="CITY" type="xs:string" />
                        <xs:element name="STATEPROV" type="xs:string" />
                        <xs:element name="ZIP" type="xs:string" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>Here's the instance file (schema testinst.xml):
    <?xml version="1.0" encoding="utf-8"?>
    <FORMINFO>
       <SUBJECT>
          <ADDR>
             <STREET>123 Main St</STREET>
             <CITY>Las Vegas</CITY>
             <STATEPROV>NV</STATEPROV>
             <ZIP>12345</ZIP>
          </ADDR>
       </SUBJECT>
    </FORMINFO>I registered the schema and created the test table:
    BEGIN
      DBMS_XMLSCHEMA.registerschema(
       schemaurl => 'http://localhost/schematest.xsd',
       schemadoc => bfilename('XMLDIR','schematest.xsd'),
       gentables => false,
       gentypes => false,
       csid => nls_charset_id('AL32UTF8'),
       options => DBMS_XMLSCHEMA.REGISTER_BINARYXML);
    END;
    CREATE TABLE BINARYTEST OF XMLType
    XMLTYPE STORE AS BINARY XML
    ALLOW ANYSCHEMA;But trying to insert gives me an ORA-44422 error (this is on Oracle 11.1.0.7.0 Enterprise):
    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(bfilename('XMLDIR', 'schematestinst.xml'), nls_charset_id('AL32UTF8'));
      6    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
      7    xschema.SchemaValidate();
      8    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
      9
    10    INSERT INTO BINARYTEST
    11    VALUES (xschema);
    12    commit;
    13  end;
    14  /
    Schema: http://localhost/schematest.xsd Validated: 1
    declare
    ERROR at line 1:
    ORA-44422: nonschema XML disallowed for this column
    ORA-06512: at line 10You can see from my put_line statement that the XMLType object is reporting its schema URL correctly and thinks it's been validated. Changing the table to "ALLOW NONSCHEMA" allows the insert, but it inserts it as a non-schema-based document. Am I skipping a step here?
    Thanks,
    Jim

    It might be a bug, but I am not yet sure...
    See the following examples...
    c:\>C:\oracle\product\11.1.0\db_1\bin\sqlplus.exe /nolog
    SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 23 22:14:41 2009
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    SQL> drop user otn cascade;
    User dropped.
    SQL> create user otn identified by otn;
    User created.
    SQL> grant xdbadmin, dba to otn;
    Grant succeeded.
    SQL> conn otn/otn
    connected.
    SQL> var schemaPath varchar2(256)
    SQL> var schemaURL  varchar2(256)
    SQL>
    SQL> begin
      2    :schemaURL := 'http://localhost/schematest.xsd';
      3    :schemaPath := '/public/schematest.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType('<?xml version="1.0" encoding="Windows-1252"?>
      4  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      5    <xs:element name="FORMINFO">
      6      <xs:complexType>
      7        <xs:sequence>
      8          <xs:element name="SUBJECT">
      9            <xs:complexType>
    10              <xs:sequence>
    11                <xs:element name="ADDR">
    12                  <xs:complexType>
    13                    <xs:sequence>
    14                      <xs:element name="STREET" type="xs:string" />
    15                      <xs:element name="CITY" type="xs:string" />
    16                      <xs:element name="STATEPROV" type="xs:string" />
    17                      <xs:element name="ZIP" type="xs:string" />
    18                    </xs:sequence>
    19                  </xs:complexType>
    20                </xs:element>
    21              </xs:sequence>
    22            </xs:complexType>
    23          </xs:element>
    24        </xs:sequence>
    25      </xs:complexType>
    26    </xs:element>
    27  </xs:schema>');
    28  begin
    29  if (dbms_xdb.existsResource(:schemaPath)) then
    30      dbms_xdb.deleteResource(:schemaPath);
    31  end if;
    32   res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    33  end;
    34  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> call dbms_xmlschema.deleteSchema(:schemaURL,4);
    Call completed.
    SQL> BEGIN
      2   DBMS_XMLSCHEMA.registerSchema(
      3    SCHEMAURL => :SchemaURL,
      4    SCHEMADOC => xdbURIType(:SchemaPath).getClob(),
      5    LOCAL     => FALSE, -- local
      6    GENTYPES  => FALSE, -- generate object types
      7    GENBEAN   => FALSE, -- no java beans
      8    GENTABLES => FALSE, -- generate object tables
      9    OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
    10    OWNER     => USER
    11   );
    12  END;
    13  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> var schemaDoc  varchar2(256)
    SQL>
    SQL> begin
      2    :schemaDoc := '/public/schematest.xml';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Create an XML Document in the repository
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> declare
      2    res boolean;
      3    xmlDoc xmlType := xmlType('<?xml version="1.0" encoding="utf-8"?>
      4  <FORMINFO>
      5     <SUBJECT>
      6        <ADDR>
      7           <STREET>123 Main St</STREET>
      8           <CITY>Las Vegas</CITY>
      9           <STATEPROV>NV</STATEPROV>
    10           <ZIP>12345</ZIP>
    11        </ADDR>
    12     </SUBJECT>
    13  </FORMINFO>');
    14  begin
    15  if (dbms_xdb.existsResource(:schemaDoc)) then
    16      dbms_xdb.deleteResource(:schemaDoc);
    17  end if;
    18   res := dbms_xdb.createResource(:schemaDoc,xmlDoc);
    19  end;
    20  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Ready to test
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> select * from tab;
    no rows selected
    SQL> CREATE TABLE BINARYTEST OF XMLType
      2  XMLTYPE STORE AS BINARY XML
      3  ALLOW ANYSCHEMA;
    Table created.
    SQL> set long 100000
    SQL> select dbms_metadata.get_ddl('TABLE','BINARYTEST',user) from dual;
    DBMS_METADATA.GET_DDL('TABLE','BINARYTEST',USER)
      CREATE TABLE "OTN"."BINARYTEST" OF "SYS"."XMLTYPE"
    OIDINDEX  ( PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" )
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    XMLTYPE COLUMN OBJECT_VALUE STORE AS BASICFILE BINARY XML (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
    BUFFER_POOL DEFAULT))
    DISALLOW NONSCHEMA
    ALLOW ANYSCHEMA
    1 row selected.
    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
      7    xschema.SchemaValidate();
      8    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
      9
    10    INSERT INTO BINARYTEST
    11    VALUES (xschema);
    12    commit;
    13  end;
    14  /
    Schema: http://localhost/schematest.xsd Validated: 1
    declare
    ERROR at line 1:
    ORA-44422: nonschema XML disallowed for this column
    ORA-06512: at line 10
    -- ORA-44421: cannot DISALLOW NONSCHEMA without a SCHEMA clause
    -- Cause: If no SCHEMA clause (explicit schema or ANYSCHEMA) was specified, nonschema data cannot be disallowed.-
    -- Action: Remove DISALLOW NONSCHEMA or add some SCHEMA clause.
    SQL> drop table binarytest;
    Table dropped.
    SQL> CREATE TABLE BINARYTEST OF XMLType
      2  XMLTYPE STORE AS BINARY XML
      3  ALLOW NONSCHEMA;
    Table created.
    SQL> select dbms_metadata.get_ddl('TABLE','BINARYTEST',user) from dual;
    DBMS_METADATA.GET_DDL('TABLE','BINARYTEST',USER)
      CREATE TABLE "OTN"."BINARYTEST" OF "SYS"."XMLTYPE"
    OIDINDEX  ( PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" )
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    XMLTYPE COLUMN OBJECT_VALUE STORE AS BASICFILE BINARY XML (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
    BUFFER_POOL DEFAULT))
    ALLOW NONSCHEMA
    DISALLOW ANYSCHEMA
    1 row selected.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
      7    xschema.SchemaValidate();
      8    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
      9
    10    INSERT INTO BINARYTEST
    11    VALUES (xschema);
    12    commit;
    13  end;
    14  /
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> select * from binarytest;
    SYS_NC_ROWINFO$
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    1 row selected.
    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
    15
    16    INSERT INTO BINARYTEST
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> create table ORtest of xmltype
      2  xmlschema "http://localhost/schematest.xsd" element "FORMINFO"
      3  ;
    Table created.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValid());
    15
    16    INSERT INTO ORTEST
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValid());
    15
    16    INSERT INTO BIN_ONE_SCHEMA
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Create an XML Document in the repository
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> declare
      2    res boolean;
      3    xmlDoc xmlType := xmlType('<?xml version="1.0" encoding="utf-8"?>
      4  <FORMINFO>
      5     <SUBJECT>
      6        <ADDR>
      7           <STREET>123 Main St</STREET>
      8           <CITY>Las Vegas</CITY>
      9           <STATEPROV>NV</STATEPROV>
    10           <ZIP>12345</ZIP>
    11           <ONE_TO_MANY>say what?</ONE_TO_MANY>
    12        </ADDR>
    13     </SUBJECT>
    14  </FORMINFO>');
    15  begin
    16  if (dbms_xdb.existsResource(:schemaDoc)) then
    17      dbms_xdb.deleteResource(:schemaDoc);
    18  end if;
    19   res := dbms_xdb.createResource(:schemaDoc,xmlDoc);
    20  end;
    21  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValid());
    15
    16    INSERT INTO BIN_ONE_SCHEMA
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
          <ONE_TO_MANY>say what?</ONE_TO_MANY>
        </ADDR>
    </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
          <ONE_TO_MANY>say what?</ONE_TO_MANY>
        </ADDR>
    </SUBJECT>
    </FORMINFO>
    declare
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00213: only 0 occurrences of particle "ADDR", minimum is 1
    ORA-06512: at "SYS.XMLTYPE", line 354
    ORA-06512: at line 13
    SQL>

  • 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

  • Schema-based xmltype table

    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

  • Derived tables with prompts - based universe

    why can't I use derived tables with prompts - based universes on Dashboard Design 4.0? I mean I can add to Dashboard Design data coming from a universe like that but the prompts don't show in the query panel in Dashboard Design. Could it be becuase my universe was created first as an unv and then I transformed it to unx?

    Good day Yuvraj,
    Thank you for your response.
    Basically, I have 2 classes based on physical tables:
    Product (P); and
    Time/Calendar (T/C).
    Two classed based on derived tables:
    Stock on Hand (SoH); and
    Stock Movements (SM)
    The derived tables SQL code selects (Quantity and Selling Price) from the SoH table and joins to the T/C table with conditions and a Where clause to restrict the data output to the last 2 months (the same applies to the SM derived table).
    Example code below:
    SELECT  q.sm_table _no, q.tim_cal_no, q.quantity, q.selling_price
    FROM    tim_cal_table p,
                  sm_table q
    WHERE  q.tim_cal_no= p.tim_cal_no
    AND        p.day between to_char(sysdate - 60,'DD/MON/YY') and to_char(sysdate - 1,'DD/MON/YY');
    Now, the SoH table and the SM table are joined (in the universe schema) to the P table and T/C table using Primary Keys (which are shared by all the tables - physical and derived i.e. foreign keys on the SoH and SM tables used in the derived tables).
    Now to answer your questions:
    Do you get data in case you take objects only from derived table class?NO
    Does the columns used to join physical table and derived table has matching values? YES. I mean to say is the join getting satisfied? YES. Checked Universe Integrity - structure, objects, joins, conditions, loops, context and cardinalities - everything is OK.
    Adding to this, is the data type same for both the columns (on which join is set) or is there any typecasting required? YES - checked the data types of the primary/foreign keys that join the tables and they all match, except for one on the SM table -  the foreign key has 6 set for precision (instead of 5 as per the other columns), however the data type is Numeric so this shouldn't be an issue.
    I hope this helps to clarify the nature of the problem.
    Thank you.
    Regards,
    B

  • 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,
    Daniel

    Hey 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

  • Why Segment shrink is not supported for tables with function-based indexes

    As we all know , Segment shrink is not supported for tables with function-based indexes.
    But i'm very confused .
    Why Segment shrink is not supported for tables with function-based indexes ?? what's its essential?

    Creating a function based index creates a hidden virtual column (you'll see it if you query user_tab_cols) and once you index a virtual column you can no longer shrink the table:orcl> create table t1(c1 number,c2 as (c1 * 2)) segment creation immediate;
    Table created.
    orcl> alter table t1 enable row movement;
    Table altered.
    orcl>
    orcl> alter table t1 shrink space;
    Table altered.
    orcl> create index i2 on t1(c2);
    Index created.
    orcl> alter table t1 shrink space;
    alter table t1 shrink space
    ERROR at line 1:
    ORA-10631: SHRINK clause should not be specified for this object
    orcl>so the issue is not with function based indexes per se, it is a level beneath that. Perhaps because the virtual column has no physical existance, when the row is moved there is no reason for Oracle to realize that an index needs updating? I haven't attempted to reverse engineer this, I would be interested to know if anyone else has.

  • Row chaining in table with more than 255 columns

    Hi,
    I have a table with 1000 columns.
    I saw the following citation: "Any table with more then 255 columns will have chained
    rows (we break really wide tables up)."
    If I insert a row populated with only the first 3 columns (the others are null), is a row chaining occurred?
    I tried to insert a row described above and no row chaining occurred.
    As I understand, a row chaining occurs in a table with 1000 columns only when the populated data increases
    the block size OR when more than 255 columns are populated. Am I right?
    Thanks
    dyahav

    user10952094 wrote:
    Hi,
    I have a table with 1000 columns.
    I saw the following citation: "Any table with more then 255 columns will have chained
    rows (we break really wide tables up)."
    If I insert a row populated with only the first 3 columns (the others are null), is a row chaining occurred?
    I tried to insert a row described above and no row chaining occurred.
    As I understand, a row chaining occurs in a table with 1000 columns only when the populated data increases
    the block size OR when more than 255 columns are populated. Am I right?
    Thanks
    dyahavYesterday, I stated this on the forum "Tables with more than 255 columns will always have chained rows." My statement needs clarification. It was based on the following:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/schema.htm#i4383
    "Oracle Database can only store 255 columns in a row piece. Thus, if you insert a row into a table that has 1000 columns, then the database creates 4 row pieces, typically chained over multiple blocks."
    And this paraphrase from "Practical Oracle 8i":
    V$SYSSTAT will show increasing values for CONTINUED ROW FETCH as table rows are read for tables containing more than 255 columns.
    Related information may also be found here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c11schem.htm
    "When a table has more than 255 columns, rows that have data after the 255th column are likely to be chained within the same block. This is called intra-block chaining. A chained row's pieces are chained together using the rowids of the pieces. With intra-block chaining, users receive all the data in the same block. If the row fits in the block, users do not see an effect in I/O performance, because no extra I/O operation is required to retrieve the rest of the row."
    http://download.oracle.com/docs/html/B14340_01/data.htm
    "For a table with several columns, the key question to consider is the (average) row length, not the number of columns. Having more than 255 columns in a table built with a smaller block size typically results in intrablock chaining.
    Oracle stores multiple row pieces in the same block, but the overhead to maintain the column information is minimal as long as all row pieces fit in a single data block. If the rows don't fit in a single data block, you may consider using a larger database block size (or use multiple block sizes in the same database). "
    Why not a test case?
    Create a test table named T4 with 1000 columns.
    With the table created, insert 1,000 rows into the table, populating the first 257 columns each with a random 3 byte string which should result in an average row length of about 771 bytes.
    SPOOL C:\TESTME.TXT
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    INSERT INTO T4 (
    COL1,
    COL2,
    COL3,
    COL255,
    COL256,
    COL257)
    SELECT
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3)
    FROM
      DUAL
    CONNECT BY
      LEVEL<=1000;
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    SET AUTOTRACE TRACEONLY STATISTICS
    SELECT
    FROM
      T4;
    SET AUTOTRACE OFF
    SELECT
      SN.NAME,
      SN.STATISTIC#,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    SPOOL OFFWhat are the results of the above?
    Before the insert:
    NAME                      VALUE                                                
    table fetch continue        166
    After the insert:
    NAME                      VALUE                                                
    table fetch continue        166                                                
    After the select:
    NAME                 STATISTIC#      VALUE                                     
    table fetch continue        252        332  Another test, this time with an average row length of about 12 bytes:
    DELETE FROM T4;
    COMMIT;
    SPOOL C:\TESTME2.TXT
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    INSERT INTO T4 (
      COL1,
      COL256,
      COL257,
      COL999)
    SELECT
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3)
    FROM
      DUAL
    CONNECT BY
      LEVEL<=100000;
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    SET AUTOTRACE TRACEONLY STATISTICS
    SELECT
    FROM
      T4;
    SET AUTOTRACE OFF
    SELECT
      SN.NAME,
      SN.STATISTIC#,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    SPOOL OFFWith 100,000 rows each containing about 12 bytes, what should the 'table fetch continued row' statistic show?
    Before the insert:
    NAME                      VALUE                                                
    table fetch continue        332 
    After the insert:
    NAME                      VALUE                                                
    table fetch continue        332
    After the select:
    NAME                 STATISTIC#      VALUE                                     
    table fetch continue        252      33695The final test only inserts data into the first 4 columns:
    DELETE FROM T4;
    COMMIT;
    SPOOL C:\TESTME3.TXT
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    INSERT INTO T4 (
      COL1,
      COL2,
      COL3,
      COL4)
    SELECT
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3),
    DBMS_RANDOM.STRING('A',3)
    FROM
      DUAL
    CONNECT BY
      LEVEL<=100000;
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    SET AUTOTRACE TRACEONLY STATISTICS
    SELECT
    FROM
      T4;
    SET AUTOTRACE OFF
    SELECT
      SN.NAME,
      SN.STATISTIC#,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      SN.NAME = 'table fetch continued row'
      AND SN.STATISTIC#=MS.STATISTIC#;
    SPOOL OFFWhat should the 'table fetch continued row' show?
    Before the insert:
    NAME                      VALUE                                                
    table fetch continue      33695
    After the insert:
    NAME                      VALUE                                                
    table fetch continue      33695
    After the select:
    NAME                 STATISTIC#      VALUE                                     
    table fetch continue        252      33695 My statement "Tables with more than 255 columns will always have chained rows." needs to be clarified:
    "Tables with more than 255 columns will always have chained rows +(row pieces)+ if a column beyond column 255 is used, but the 'table fetch continued row' statistic +may+ only increase in value if the remaining row pieces are found in a different block."
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.
    Edited by: Charles Hooper on Aug 5, 2009 9:52 AM
    Paraphrase misspelled the view name "V$SYSSTAT", corrected a couple minor typos, and changed "will" to "may" in the closing paragraph as this appears to be the behavior based on the test case.

  • How to create a table with more tan 20 columns

    I created a A4 landscape document to make a calendar for the next year.
    To add the date information I need to insert a table with 32 columns (name of month + 31 days). It should be possible to create a table with a over all width of 29.7 cm (consisting of 1 column of 4.9 cm and 31 columns with 0.8 cm)?
    Remark: Yet reduced all indention's (? German: Einzug) and other spacers and the size of used font of the table.

    Hello Till,
    unfortunatly Pages connot create a table with more than 20 columns. This is no question of size or place.
    But you can create two tables, set the most right border of the fist table to "no line" and align the second table (with the other 12 columns) at the right side of the first table. Now you have "one" table with 32 columns.
    I have done this with my driving book (Fahrtenbuch, um es korrekt zu schreiben and it works fine.
    Frank.

  • Table with more than 35 columns

    Hello All.
    How can one work with a table with more than 35 columns
    on JDev 9.0.3.3?
    My other question is related to this.
    Setting Entities's Beans properties from a Session Bean
    bought up the error, but when setting from inside the EJB,
    the bug stays clear.
    Is this right?
    Thank you

    Thank you all for reply.
    Here's my problem:
    I have an AS400/DB2 Database, a huge and an old one.
    There is many COBOL Programs used to communicate with this DB.
    My project is to transfer the database with the same structure and the same contents to a Linux/ORACLE System.
    I will not remake the COBOL Programs. I will use the existing one on the Linux System.
    So the tables of the new DB should be the same as the old one.
    That’s why I can not make a relational DB. I have to make an exact migration.
    Unfortunately I have some tables with more than 5000 COLUMNS.
    Now my question is:
    can I modify the parameters of the ORACE DB to make it accept Tables and Views with more than 1000 columns, If not, is it possible to make a PL/SQL Function that simulate a table, this function will insert/update/select data from many other small tables (<1000 columns). I want to say a method that make the ORACLE DB acting like if it has a table with a huge number of columns;
    I know it's crazy but any idea please.

  • How to create a table with varied number of columns?

    I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
    If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
    Can I do it? How? Thanka a lot.

    Why did you create a new thread for this?
    How to create a table with varied number of columns?

  • How can i export the data to excel which has 2 tables with same number of columns & column names?

    Hi everyone, again landed up with a problem.
    After trying a lot to do it myself, finally decided to post here..
    I have created a form in form builder 6i, in which on clicking a button the data gets exported to excel sheet.
    It is working fine with a single table. The problem now is that i am unable to do the same with 2 tables.
    Because both the tables have same number of columns & column names.
    Below are 2 tables with column names:
    Table-1 (MONTHLY_PART_1)
    Table-2 (MONTHLY_PART_2)
    SL_NO
    SL_NO
    COMP
    COMP
    DUE_DATE
    DUE_DATE
    U-1
    U-1
    U-2
    U-2
    U-4
    U-4
    U-20
    U-20
    U-25
    U-25
    Since both the tables have same column names, I'm getting the following error :
    Error 402 at line 103, column 4
      alias required in SELECT list of cursor to avoid duplicate column names.
    So How can i export the data to excel which has 2 tables with same number of columns & column names?
    Should i paste the code? Should i post this query in 'SQL and PL/SQL' Forum?
    Help me with this please.
    Thank You.

    You'll have to *alias* your columns, not prefix it with the table names:
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id, b.id, a.val1, b.val1, a.val2, b.val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
      for rData in cData loop
    ERROR at line 18:
    ORA-06550: line 18, column 3:
    PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
    ORA-06550: line 18, column 3:
    PL/SQL: Statement ignored
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id a_id, b.id b_id, a.val1 a_val1, b.val1 b_val1, a.val2 a_val2, b.val2 b_val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
    PL/SQL procedure successfully completed.
    cheers

Maybe you are looking for

  • Animating a line chart on click?

    I have a line chart that has multiple points of data on it that shows growth from 2008 - 2013.  I'm going to be giving a presentation to show this growth, but I want to emphasize a point in the middle (around 2011) where the growth skyrocketed.  To d

  • I have a problem when I updated CS6:

    hi, I have a problem when I updated CS6: Extension Manager 6.0.5 Update Installation failed. Error Code: U44M1P7 Adobe Photoshop 13.0.5 Done with Errors. Error Code: U44M1P6 What is it? Thx Message was edited by: PhotoPlusMore

  • Oracle Discoverer 4.1 to Oracle Discoverer11g  EUL migration steps

    Hi WE SUCCESSFULLY upgraded Discoverer 3.1 to 4.1 EUL against Oracle 8i DB. Also  exported all EUL4 objects and imported the same to 11gr2 Db. But when we try to upgrade from Oracle BI 11g Discoverer Admin by connecting against the imported EUL4 sche

  • BEA 8.1 Silent Install

    The Silent install fails for unix (haven't tried windows) Here are excerpts from the log file. Strange thing is, it says the install completed successfully. 2004-05-26 14:24:05,496 INFO [loadNamespace] com.bea.plateng.wizard.ControllerProxy - Created

  • Canon 6320 printer refuses to copy

    My Canon Pixma 6320 Printer refuses to copy - any ideas?