Importing XMLTYPE columns
Hi,
I'm trying to use exp/imp utilities to backup my schema.
One of the tables (REQUEST) has an XMLTYPE column in it. I can successfully export the user with all objects:
exp userid=testuser/testuser@qabfi parfile==exp_testuser.dat
But when
I'm trying to imp the user, I'm getting an Oracle error:
imp testuser/testuser@qabfi file=testuser.dmp full=yes
. . importing table "REQUEST"
IMP-00058: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00028: partial import of previous table rolled back: 40 rows roll back
Actually, no rows are imported.
But after I drop XMLTYPE column from REQUEST table, exp/imp work just fine.
Does anybody know anything about this problem, and is there any workaround?
Thanks -
Alla
Could be a bug. Refer to Note 526464.996 on Metalink
Similar Messages
-
Impdp, XMLType column and ora-26093
Hello!
I have some problem with importing XMLType columns with data longer than 2000 symbols.
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
test data:
create table some_tab (id varchar2(10), xml XMLType);
insert into some_tab values('short', XMLType('<foo></foo>'));
-- we use clob to pass more than 2000 symbols
declare
c clob := '<x> || lpad('</x>', 2700, 'a');
begin
insert into some_tab values('long', XMLType(c));
end;
then I export data with expdp...
and if I import dump into other schema on the same server - that's ok,
BUT if I import data into schema on other server - I have this error:
KUP-11007: conversion error loading table ......
ORA-26093: input data column size (2707) exceeds the maximum input size (2000)
KUP-11009: data for row: ....
what I'm doing wrong?
thank youuser2606534 wrote:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
ORA-26093: input data column size (2707) exceeds the maximum input size (2000)
Bug 7209038
DATAPUMP NOT IMPORTING XMLTYPE OBJECTS. ORA-26093
Currently no workaround is available for this, although 11gR2 should have it fixed. -
Import is very Slow with xmltype column in oracle 9.2.0.7
Hi
We are using oracle 9.2.0.7 on Solaris
The import without XMLTYPE column is faster the import of the table with XMLTYPE column.Also when we do the export in direct path it is still going for Conventional(I suppose this is correct for XMLTYPE).
Is this the general behaviour of XMLTYPE...if so how to improve the performance of the import.
Can anybody help us out in resolving the issue.here is the output
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
CREATE TABLE "MMSCBMC"."PAYMENTS_AUDIT"
( "PMTID" NUMBER NOT NULL ENABLE,
"PMTSTATUS" VARCHAR2(32) NOT NULL ENABLE,
"PMTSTATUS_CODE" VARCHAR2(10) NOT NULL ENABLE,
"CSREFID" VARCHAR2(32),
"CURAMT" NUMBER(15,2) NOT NULL ENABLE,
"CUSTOMER_KEY" NUMBER NOT NULL ENABLE,
"ACCTID" VARCHAR2(32) NOT NULL ENABLE,
"BANKREFID" VARCHAR2(34) NOT NULL ENABLE,
"PAYEEID" NUMBER,
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
"PAYMENTS_AUDIT_KEY" NUMBER NOT NULL ENABLE,
"PROCDATE" DATE NOT NULL ENABLE,
"DUEDATE" DATE NOT NULL ENABLE,
"IMMEDIATE_GENERATION" NUMBER DEFAULT 0 NOT NULL ENABLE,
"RECURRINGPMTID" NUMBER,
"BATCHID" NUMBER,
"REMIT_INFO" VARCHAR2(200),
"BILLING_ACCT" VARCHAR2(32),
"PAYMENT_METHOD" VARCHAR2(20) NOT NULL ENABLE,
"IS_ACCTNUMBER" NUMBER,
"SPREFID" VARCHAR2(36),
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
"FIDEBITTRCNUM" VARCHAR2(32),
"FEE" NUMBER(12,2),
"FEE_TYPE" VARCHAR2(10) DEFAULT NULL ,
"DATE_ADDED" DATE NOT NULL ENABLE,
"CLIENTIP" VARCHAR2(32) NOT NULL ENABLE,
"LAST_UPDATED" DATE NOT NULL ENABLE,
"ACTION" VARCHAR2(32),
"MODIFIEDBY" VARCHAR2(32) NOT NULL ENABLE,
"ISCSR" VARCHAR2(1) NOT NULL ENABLE,
"SUBUSER_KEY" NUMBER,
"TOKEN" NUMBER DEFAULT 0 NOT NULL ENABLE,
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
"FUNDINGSTATUS_CODE" NUMBER DEFAULT 0 NOT NULL ENABLE,
"FUNDINGSTATUS" VARCHAR2(32) DEFAULT 'Funds Pending' NOT NULL ENABLE,
"PRODUCT_CODE" VARCHAR2(10),
"SUB_PRODUCT_CODE" VARCHAR2(10),
"ACCT_TYPE" VARCHAR2(3),
"DEST_PRODUCT_CODE" VARCHAR2(10),
"DEST_SUB_PRODUCT_CODE" VARCHAR2(10),
"DEST_BANKREFID" VARCHAR2(34),
"DEST_ACCT_TYPE" VARCHAR2(3),
"ISDEBIT" NUMBER NOT NULL ENABLE,
"PAYMENTFROM_NICKNAME" VARCHAR2(96),
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
"PAYMENTFROM_ACCTID" VARCHAR2(32),
"PAYMENTTO_NICKNAME" VARCHAR2(96),
"PAYMENTTO_ACCTID" VARCHAR2(32),
"DEST_ISBUSINESSACCT" NUMBER,
"APPROVE_DATE" DATE,
"APPROVE_KEY" NUMBER,
"LAST_MODIFIER_KEY" NUMBER,
"CHECK_DESC" VARCHAR2(200),
"FAILURE_REASON" VARCHAR2(250),
"PMTFUNDRETRY_COUNT" NUMBER DEFAULT 0 ,
"MQ_TRANSACTIONID" NUMBER,
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
"FREQUENCY" NUMBER,
"NUMBEROFREMPAYMENTS" NUMBER,
"OPENENDED" NUMBER,
"ORIGINATOR_KEY" NUMBER NOT NULL ENABLE,
"EXTERNALREFERENCE" "SYS"."XMLTYPE" ,
"EXTERNALINFO" "SYS"."XMLTYPE" ,
"PRINCIPAL_AMT" NUMBER(15,2),
"ESCROW_AMT" NUMBER(15,2),
"LATEFEE_AMT" NUMBER(15,2),
"OTHERFEE_AMT" NUMBER(15,2),
"REGULARPMT_AMT" NUMBER(15,2),
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
CONSTRAINT "PK_PAYMENTSADT_KEY" PRIMARY KEY ("LAST_UPDATED", "PAYMENTS_AUDIT_K
EY")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "MMS_DATA_TBS" ENABLE,
CONSTRAINT "FK01_PAYMENTS_AUDIT" FOREIGN KEY ("APPROVE_KEY")
REFERENCES "MMSCBMC"."CUSTOMER" ("CUSTOMER_KEY") ENABLE,
CONSTRAINT "FK02_PAYMENTS_AUDIT" FOREIGN KEY ("LAST_MODIFIER_KEY")
REFERENCES "MMSCBMC"."CUSTOMER" ("CUSTOMER_KEY") ENABLE,
CONSTRAINT "FK06_PAYMENTS_AUDIT" FOREIGN KEY ("ORIGINATOR_KEY")
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
REFERENCES "MMSCBMC"."ORIGINATOR" ("ORIGINATOR_KEY") ENABLE
) PCTFREE 2 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING
STORAGE(
BUFFER_POOL DEFAULT)
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS"
PARTITION BY RANGE ("LAST_UPDATED")
(PARTITION "M1_2005" VALUES LESS THAN (TO_DATE(' 2005-02-01 00:00:00', 'SYYYY-
MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
PCTFREE 2 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS"
LOB ("SYS_NC00059$") STORE AS (
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSI
ON 10
NOCACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
LOB ("SYS_NC00061$") STORE AS (
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSI
ON 10
NOCACHE
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) NOCOMPRESS ,
PARTITION "M2_2005" VALUES LESS THAN (TO_DATE(' 2005-03-01 00:00:00', 'SYYYY-M
M-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
PCTFREE 2 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS"
LOB ("SYS_NC00059$") STORE AS (
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSI
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
ON 10
NOCACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
LOB ("SYS_NC00061$") STORE AS (
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSI
ON 10
NOCACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) NOCOMPRESS ,
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
PARTITION "MAX_VALUE" VALUES LESS THAN (MAXVALUE)
PCTFREE 2 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS"
LOB ("SYS_NC00059$") STORE AS (
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSI
ON 10
NOCACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
DBMS_METADATA.GET_DDL('TABLE','PAYMENTS_AUDIT')
LOB ("SYS_NC00061$") STORE AS (
TABLESPACE "PAYMENTS_AUDIT_DATA_TBS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSI
ON 10
NOCACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) NOCOMPRESS ) -
Export and import XMLType table
Hi ,
I want to export one table which contain xmltype column form oracle 11.2.0.1.0 and import into 11.2.0.2.0 version.
I got following errors when i export the table , when i tried with exp and imp utility
EXP-00107: Feature (BINARY XML) of column ZZZZ in table XXXX.YYYY is not supported. The table will not be exported.
then i tried export and import pump.Exporting pump is working ,following is the log
Export: Release 11.2.0.1.0 - Production on Wed Oct 17 17:53:41 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
;;; Legacy Mode Active due to the following parameters:
;;; Legacy Mode Parameter: "log=<xxxxx>Oct17.log" Location: Command Line, Replaced with: "logfile=T<xxxxx>_Oct17.log"
;;; Legacy Mode has set reuse_dumpfiles=true parameter.
Starting "<xxxxx>"."SYS_EXPORT_TABLE_01": <xxxxx>/******** DUMPFILE=<xxxxx>Oct172.dmp TABLES=<xxxxx>.<xxxxx> logfile=<xxxxx>Oct17.log reusedumpfiles=true
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 13.23 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "<xxxxx>"."<xxxxx>" 13.38 GB 223955 rows
Master table "<xxxxx>"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
Dump file set for <xxxxx>.SYS_EXPORT_TABLE_01 is:
E:\ORACLEDB\ADMIN\LOCALORA11G\DPDUMP\<xxxxx>OCT172.DMP
Job "<xxxxx>"."SYS_EXPORT_TABLE_01" successfully completed at 20:30:14
h4. I got error when i import the pump using following command
+impdp sys_dba/***** dumpfile=XYZ_OCT17_2.DMP logfile=import_vmdb_XYZ_Oct17_2.log FROMUSER=XXXX TOUSER=YYYY CONTENT=DATA_ONLY TRANSFORM=oid:n TABLE_EXISTS_ACTION=append;+
error is :
h3. KUP-11007: conversion error loading table "CC_DBA"."XXXX"*
h3. ORA-01403: no data found*
h3. ORA-31693: Table data object "XXX_DBA"."XXXX" failed to load/unload and is being skipped due to error:*
Please help me to get solution for this.CREATE UNIQUE INDEX "XXXXX"."XXXX_XBRL_XMLINDEX_IX" ON "CCCC"."XXXX_XBRL" (EXTRACTVALUE(SYS_MAKEXML(128,"SYS_NC00014$"),'/xbrl'))above index is created by us because we are storing file which like
<?xml version="1.0" encoding="UTF-8"?>
<xbrl xmlns="http://www.xbrl.org/2003/instance" xmlns:AAAAAA="http://www.AAAAAA.COM/AAAAAA" xmlns:ddd4217="http://www.xbrl.org/2003/ddd4217" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<link:schemaRef xlink:href="http://www.fsm.AAAAAA.COM/AAAAAA-xbrl/v1/AAAAAA-taxonomy-2009-v2.11.xsd" xlink:type="simple" />
<context id="Company_Current_ForPeriod"> ...I tried to export pump with and without using DATA_OPTIONS=XML_CLOBS too.Both time exporting was success but import get same KUP-11007: conversion error loading table "tab_owner"."bbbbb_XBRL" error.
I tried the import in different ways
1. Create table first then import data_only (CONTENT=DATA_ONLY)
2. Import all table
In both way table ddl is created successfully ,but it fail on import data.Following is the log when i importing
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "aaaaa"."SYS_IMPORT_TABLE_02" successfully loaded/unloaded
Starting "aaaaa"."SYS_IMPORT_TABLE_02": aaaaa/********@vm_dba TABLES=tab_owner.bbbbb_XBRL dumpfile=bbbbb_XBRL_OCT17_2.DMP logfile=import_vmdb
bbbbb_XBRL_Oct29.log DATA_OPTIONS=SKIP_CONSTRAINT_ERRORS
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
*KUP-11007: conversion error loading table "tab_owner"."bbbbb_XBRL"*
*ORA-01403: no data found*
ORA-31693: Table data object "tab_owner"."bbbbb_XBRL" failed to load/unload and is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-26062: Can not continue from previous errors.
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "aaaaa"."SYS_IMPORT_TABLE_02" completed with 1 error(s) at 18:42:26 -
How to create index on XMLType column extension?
I have an XMLType column named "info" whose corresponding global element has a complexType "InfoType" in namespace "http://example.org/ord". The "InfoType" complexType is extended in two namespaces, "http://example.org/info/zipcode" and "http://example.org/info/street". How do I create a unique index using an "InfoType" element contributed from one of the extension namespaces?
I have included below a SQL script that completely describes the problem.
Thanks in advance for your assistance?
- Ron
BEGIN
DBMS_XMLSCHEMA.registerSchema(
'chapter04prod.xsd',
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://example.org/prod"
targetNamespace="http://example.org/prod"
elementFormDefault="unqualified">
<xsd:complexType name="ItemsType">
<xsd:sequence>
<xsd:element name="product" type="ProductType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ProductType">
<xsd:sequence>
<xsd:element name="number" type="xsd:integer"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="size" type="SizeType"/>
<xsd:element name="color" type="ColorType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SizeType">
<xsd:simpleContent>
<xsd:extension base="xsd:integer">
<xsd:attribute name="system" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ColorType">
<xsd:attribute name="value" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>',
TRUE,
TRUE,
FALSE,
FALSE);
END;
BEGIN
DBMS_XMLSCHEMA.registerSchema(
'chapter04ord1.xsd',
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://example.org/ord"
xmlns="http://example.org/ord"
xmlns:prod="http://example.org/prod"
elementFormDefault="qualified">
<xsd:import namespace="http://example.org/prod"
schemaLocation="chapter04prod.xsd"/>
<xsd:simpleType name="OrderNumType">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="InfoType"/>
<xsd:complexType name="CustomerType">
<xsd:all>
<xsd:element name="name" type="CustNameType"/>
<xsd:element name="number" type="xsd:integer"/>
<xsd:element name="info" type="InfoType" form="unqualified"/>
</xsd:all>
</xsd:complexType>
<xsd:simpleType name="CustNameType">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:element name="order" type="OrderType"/>
<xsd:element name="customer" type="CustomerType"/>
<xsd:complexType name="OrderType">
<xsd:sequence>
<xsd:element name="number" type="OrderNumType"/>
<xsd:element name="customer" type="CustomerType"
maxOccurs="unbounded"/>
<xsd:element name="items" type="prod:ItemsType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>',
TRUE,
TRUE,
FALSE,
FALSE);
END;
BEGIN
DBMS_XMLSCHEMA.registerSchema(
'chapter04infozipcode.xsd',
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ord="http://example.org/ord"
xmlns="http://example.org/info/zipcode"
targetNamespace="http://example.org/info/zipcode"
elementFormDefault="unqualified">
<xsd:import namespace="http://example.org/ord"
schemaLocation="chapter04ord1.xsd"/>
<xsd:complexType name="InfoType">
<xsd:complexContent>
<xsd:extension base="ord:InfoType">
<xsd:sequence>
<xsd:element name="zipcode" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>',
TRUE,
TRUE,
FALSE,
FALSE);
END;
BEGIN
DBMS_XMLSCHEMA.registerSchema(
'chapter04infostreet.xsd',
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ord="http://example.org/ord"
xmlns="http://example.org/info/street"
targetNamespace="http://example.org/info/street"
elementFormDefault="unqualified">
<xsd:import namespace="http://example.org/ord"
schemaLocation="chapter04ord1.xsd"/>
<xsd:complexType name="InfoType">
<xsd:complexContent>
<xsd:extension base="ord:InfoType">
<xsd:sequence>
<xsd:element name="street" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>',
TRUE,
TRUE,
FALSE,
FALSE);
END;
BEGIN
DBMS_XMLSCHEMA.registerSchema(
'chapter04nonamespace.xsd',
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ord="http://example.org/ord">
<xsd:import namespace="http://example.org/ord"
schemaLocation="chapter04ord1.xsd"/>
<xsd:element name="info" type="ord:InfoType">
</xsd:schema>',
TRUE,
TRUE,
FALSE,
FALSE);
END;
CREATE TABLE customer (
name VARCHAR(64),
number INTEGER,
info XMLTYPE)
XMLType info STORE AS OBJECT RELATIONAL
XMLSCHEMA "chapter04nonamespace.xsd"
ELEMENT "info";
INSERT INTO customer (name, number, info)
VALUES ('George Jones', 1,
XMLType(
'<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:street="http://example.org/info/zipcode"
xsi:type="zipcode:InfoType">
<zipcode>28877</zipcode>
</info>');
INSERT INTO customer (name, number, info)
VALUES ('Jim Jones', 2,
XMLType(
'<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:street="http://example.org/info/street"
xsi:type="street:InfoType">
<street>3456 Autumn Lane</street>
</info>');
SELECT name,
extractValue(info, '/info/street')
FROM customer
WHERE extractValue(info, '/info/street/text()') LIKE '3456%';
-- How does one create a unique index as follows?
CREATE UNIQUE INDEX customer_infostreet ON customer (??????);
-- The following insert should fail with unique index violation!
INSERT INTO customer (name, number, info)
VALUES ('Jerry Jones', 3,
XMLType(
'<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:street="http://example.org/info/street"
xsi:type="street:InfoType">
<street>3456 Autumn Lane</street>
</info>');Ron
Glad you found a solution.. However a more efficient solution is show below
SQL> connect sys/ as sysdba
Enter password:
Connected.
SQL> set define on
SQL> --
SQL> define USERNAME = OTNTEST
SQL> --
SQL> def PASSWORD = OTNTEST
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user OTNTEST cascade
User dropped.
SQL> grant connect, resource to &USERNAME identified by &PASSWORD
2 /
old 1: grant connect, resource to &USERNAME identified by &PASSWORD
new 1: grant connect, resource to OTNTEST identified by OTNTEST
Grant succeeded.
SQL> grant create any directory, drop any directory to &USERNAME
2 /
old 1: grant create any directory, drop any directory to &USERNAME
new 1: grant create any directory, drop any directory to OTNTEST
Grant succeeded.
SQL> grant alter session, create view to &USERNAME
2 /
old 1: grant alter session, create view to &USERNAME
new 1: grant alter session, create view to OTNTEST
Grant succeeded.
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new 1: alter user OTNTEST default tablespace USERS temporary tablespace TEMP
User altered.
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> alter session set events ='19027 trace name context forever, level 0x800'
2 /
Session altered.
SQL> BEGIN
2 DBMS_XMLSCHEMA.registerSchema(
3 'chapter04prod.xsd',
4 '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://example.org/prod" targetNamespa
fault="unqualified">
5 <xsd:complexType name="ItemsType">
6 <xsd:sequence>
7 <xsd:element name="product" type="ProductType"/>
8 </xsd:sequence>
9 </xsd:complexType>
10 <xsd:complexType name="ProductType">
11 <xsd:sequence>
12 <xsd:element name="num" type="xsd:integer"/>
13 <xsd:element name="name" type="xsd:string"/>
14 <xsd:element name="size" type="SizeType"/>
15 <xsd:element name="color" type="ColorType"/>
16 </xsd:sequence>
17 </xsd:complexType>
18 <xsd:complexType name="SizeType">
19 <xsd:simpleContent>
20 <xsd:extension base="xsd:integer">
21 <xsd:attribute name="system" type="xsd:string"/>
22 </xsd:extension>
23 </xsd:simpleContent>
24 </xsd:complexType>
25 <xsd:complexType name="ColorType">
26 <xsd:attribute name="value" type="xsd:string"/>
27 </xsd:complexType>
28 </xsd:schema>',
29 TRUE, TRUE, FALSE, FALSE);
30 END;
31 /
PL/SQL procedure successfully completed.
SQL> BEGIN
2 DBMS_XMLSCHEMA.registerSchema(
3 'chapter04ord1.xsd',
4 '<xsd:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
://example.org/prod" targetNamespace="http://example.org/ord" elementFormDefault="qualified">
5 <xsd:import namespace="http://example.org/prod" schemaLocation="chapter04prod.xsd"/>
6 <xsd:simpleType name="OrderNumType">
7 <xsd:restriction base="xsd:string"/>
8 </xsd:simpleType>
9 <xsd:complexType name="InfoType" xdb:SQLType="INFO_TYPE_T"/>
10 <xsd:complexType name="CustomerType">
11 <xsd:all>
12 <xsd:element name="name" type="CustNameType"/>
13 <xsd:element name="num" type="xsd:integer"/>
14 <xsd:element name="info" type="InfoType" minOccurs="1" form="unqualified"/>
15 </xsd:all>
16 </xsd:complexType>
17 <xsd:simpleType name="CustNameType">
18 <xsd:restriction base="xsd:string"/>
19 </xsd:simpleType>
20 <xsd:element name="customers" type="CustomersType"/>
21 <xsd:complexType name="CustomersType">
22 <xsd:sequence>
23 <xsd:element name="customer" type="CustomerType" minOccurs="0" maxOccurs="unbounded"
24 </xsd:sequence>
25 </xsd:complexType>
26 <xsd:element name="order" type="OrderType"/>
27 <xsd:element name="customer" type="CustomerType"/>
28 <xsd:complexType name="OrderType">
29 <xsd:sequence>
30 <xsd:element name="num" type="OrderNumType"/>
31 <xsd:element name="customer" type="CustomerType" maxOccurs="unbounded"/>
32 <xsd:element name="items" type="prod:ItemsType"/>
33 </xsd:sequence>
34 </xsd:complexType>
35 </xsd:schema>',
36 TRUE, TRUE, FALSE, FALSE);
37 END;
38 /
PL/SQL procedure successfully completed.
SQL> BEGIN
2 DBMS_XMLSCHEMA.registerSchema(
3 'chapter04infozipcode.xsd',
4 '<xsd:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
//example.org/info/zipcode" targetNamespace="http://example.org/info/zipcode" elementFormDefault="unqualifie
5 <xsd:import namespace="http://example.org/ord" schemaLocation="chapter04ord1.xsd"/>
6 <xsd:complexType name="InfoType" xdb:SQLType="ZIPCODE_INFO_TYPE_T">
7 <xsd:complexContent>
8 <xsd:extension base="ord:InfoType">
9 <xsd:sequence>
10 <xsd:element name="zipcode" type="xsd:string"/>
11 <xsd:element name="suffix" type="xsd:string"/>
12 </xsd:sequence>
13 </xsd:extension>
14 </xsd:complexContent>
15 </xsd:complexType>
16 </xsd:schema>',
17 TRUE, TRUE, FALSE, FALSE);
18 END;
19 /
PL/SQL procedure successfully completed.
SQL>
SQL> BEGIN
2 DBMS_XMLSCHEMA.registerSchema(
3 'chapter04infostreet.xsd',
4 '<xsd:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
//example.org/info/street" targetNamespace="http://example.org/info/street" elementFormDefault="unqualified"
5 <xsd:import namespace="http://example.org/ord" schemaLocation="chapter04ord1.xsd"/>
6 <xsd:complexType name="InfoType" xdb:SQLType="STREET_INFO_TYPE_T">
7 <xsd:complexContent>
8 <xsd:extension base="ord:InfoType">
9 <xsd:sequence>
10 <xsd:element name="street" type="xsd:string"/>
11 <xsd:element name="suffix" type="xsd:string"/>
12 </xsd:sequence>
13 </xsd:extension>
14 </xsd:complexContent>
15 </xsd:complexType>
16 </xsd:schema>',
17 TRUE, TRUE, FALSE, FALSE);
18 END;
19 /
PL/SQL procedure successfully completed.
SQL>
SQL> BEGIN
2 DBMS_XMLSCHEMA.registerSchema(
3 'chapter04nonamespace.xsd',
4 '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ord="http://example.org/ord">
5 <xsd:import namespace="http://example.org/ord" schemaLocation="chapter04ord1.xsd"/>
6 <xsd:element name="info" type="ord:InfoType"/>
7 </xsd:schema>',
8 TRUE, TRUE, FALSE, FALSE);
9 END;
10 /
PL/SQL procedure successfully completed.
SQL>
SQL> CREATE TABLE customer (
2 name VARCHAR(64),
3 num INTEGER,
4 info XMLTYPE)
5 XMLType info STORE AS OBJECT RELATIONAL
6 XMLSCHEMA "chapter04nonamespace.xsd"
7 ELEMENT "info";
Table created.
SQL>
SQL> INSERT INTO customer (name, num, info)
2 VALUES ('George Jones', 1,
3 XMLType(
4 '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zipcode="http://example.org/info/zip
5 <zipcode>28877</zipcode>
6 <suffix>s1</suffix>
7 </info>'));
1 row created.
SQL>
SQL> INSERT INTO customer (name, num, info)
2 VALUES ('Jim Jones', 2,
3 XMLType(
4 '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:street="http://example.org/info/stre
5 <street>3456 Autumn Lane</street>
6 <suffix>s2</suffix>
7 </info>'));
1 row created.
SQL> /
1 row created.
SQL> SELECT name,
2 extractValue(info, '/info/zipcode'),
3 extractValue(info, '/info/street')
4 FROM customer
5 WHERE extractValue(info, '/info/zipcode/text()') LIKE '2%'
6 OR extractValue(info, '/info/street/text()') LIKE '3456%';
NAME
EXTRACTVALUE(INFO,'/INFO/ZIPCODE')
EXTRACTVALUE(INFO,'/INFO/STREET')
George Jones
28877
Jim Jones
3456 Autumn Lane
NAME
EXTRACTVALUE(INFO,'/INFO/ZIPCODE')
EXTRACTVALUE(INFO,'/INFO/STREET')
Jim Jones
3456 Autumn Lane
SQL>
SQL> CREATE UNIQUE INDEX customer_infozipcode ON customer(
2 extractValue
3 (
4 info,
5 '/info[@xsi:type="zipcode:InfoType"]/zipcode',
6 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xmlns:zipcode="http://example.org/info/zipcode"'
8 ))
9 /
Index created.
SQL> select column_name
2 from user_ind_columns
3 where INDEX_NAME = 'CUSTOMER_INFOZIPCODE'
4 /
COLUMN_NAME
SYS_NC00014$
SQL> select INDEX_NAME,COLUMN_EXPRESSION
2 from user_ind_expressions
3 /
INDEX_NAME
COLUMN_EXPRESSION
CUSTOMER_INFOZIPCODE
EXTRACTVALUE(SYS_MAKEXML('0341F05603124922B4F6F94DC5E30C2F',4870,"SYS_NC00004$",
SQL> DROP INDEX CUSTOMER_INFOZIPCODE
2 /
Index dropped.
SQL> desc INFO_TYPE_T
INFO_TYPE_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
SQL> --
SQL> desc ZIPCODE_INFO_TYPE_T
ZIPCODE_INFO_TYPE_T extends OTNTEST.INFO_TYPE_T
ZIPCODE_INFO_TYPE_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
zipcode VARCHAR2(4000 CHAR)
suffix VARCHAR2(4000 CHAR)
SQL> --
SQL> desc STREET_INFO_TYPE_T
STREET_INFO_TYPE_T extends OTNTEST.INFO_TYPE_T
STREET_INFO_TYPE_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
street VARCHAR2(4000 CHAR)
suffix VARCHAR2(4000 CHAR)
SQL> --
SQL> CREATE UNIQUE INDEX customer_infozipcode ON customer(TREAT(INFO.XMLDATA AS ZIPCODE_INFO_TYPE_T)."zipcod
2 /
Index created.
SQL> select column_name
2 from user_ind_columns
3 where INDEX_NAME = 'CUSTOMER_INFOZIPCODE'
4 /
COLUMN_NAME
TREAT("SYS_NC00007$" AS "ZIPCODE_INFO_TYPE_T")."zipcode"
SQL> select INDEX_NAME,COLUMN_EXPRESSION
2 from user_ind_expressions
3 /
no rows selected
SQL> INSERT INTO customer (name, num, info)
2 VALUES ('Jerry Jones', 3,
3 XMLType(
4 '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zipcode="http://example.org/info/zip
5 <zipcode>28877</zipcode>
6 <suffix>s1</suffix>
7 </info>'))
8 /
INSERT INTO customer (name, num, info)
ERROR at line 1:
ORA-00001: unique constraint (OTNTEST.CUSTOMER_INFOZIPCODE) violated
SQL> INSERT INTO customer (name, num, info)
2 VALUES ('Jerry Jones', 3,
3 XMLType(
4 '<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:street="http://example.org/info/stre
5 <street>3456 Autumn Lane</street>
6 <suffix>s3</suffix>
7 </info>'))
8 /
1 row created.
SQL>In you solution a functional index was created. In my case, by breaking the XML abstraction, and using object-relational SQL to create the index (DDL statements are the one case where I feel this is acceptable) I was able to create a pure B-TREE index which has the same effect.. -
Problems sorting larger sets of XMLType columns/tables
Hi,
Here's something I tried to wrap my head around:
I'm using Oracle 11g r1 for Windows Server 2003.
I've imported a fairly large set of XML files into a temporary XMLType table. Now
I want to sort the contents of the table and put them into another table which
uses a sequence to get primary keys (would be a longer story to explain, basically
sorting by this non-XML primary key is super-fast as opposed to everything else
I've tried, plus I need something unique):
INSERT INTO realtable SELECT 0, object_value
FROM tmptable ORDER BY extractValue(object_value, '/some/*/field');It works fine for a very small number of rows but when I tried with about 30000 rows,
still not too much, two kinds of things can happen. Either, Oracle gobbles up a huge amount
of memory (>1,5GB) until the statement breaks:
ORA-04030: Zu wenig Prozessspeicher fⁿr Versuch 33292 Bytes zuzuweisen
(callheap,kllcqgf:kllsltba)Or I get something like this:
ORA-00600: Interner Fehlercode, Argumente: [kqludp2], [0x1F31EC94], [0], [], [], [], [], []I haven't wasted too much time looking into this. I tried storage options clob and binary xml
for tmptable. Clob seems to induce the latter problem and binary xml the former but I haven't
made further experiments.
I can create a workaround from outside Oracle I think, so it's not serious however I'd would
be interesting to know what happened or if there is a better way to do this.
Thanks!Unfortunately, the problems are not reproducible in a meaningful way. All I can say is that once a statement will result in a kqludp2, it will always fail with the exactly same error message until I reinstall the database from scratch. On the other
side, when I found a configuration that works, I could delete and rebuild/refill a table multiple times without the thing ever breaking.
As the most recent example, after the latest trouble I deleted the database and changed my DDL scripts to the last configuration I wanted to try and broke the last time (several tables with two normal columns and an XMLType column each), everything worked like a breeze.
I can file a TAR when I get a support ID from my employer, however I installed the database on a virtual machine (I should have mentioned that earlier) and Oracle doesn't officially support that configuration from what I know so I'll doubt they'll do anything about it. I've procured a physical computer now and try to reproduce any of the problems when I get to it. -
A collegue just asked me the following:
He wants to copy data from one database table to the same table on another database. The table has a XMLTYPE column. Is there a way other than export/import to copy the table to a file including XML-Values and Insert from the file to the target table?
Export/Import seems the correct approach to me, however he doesn't have neccessary rights to do so. Do you know any easy other way?Why not use a DB link?
XMLTypes can be copied through DB links:
SQL> create table t as select * from t@dev1;
Table created.
SQL> select table_name, column_name, data_type from user_tab_cols where table_name = 'T';
TABLE_NAME COLUMN_NAME DATA_TYPE
T X XMLTYPE
T SYS_NC00002$ CLOB -
How to store XML fragments in a XMLTYPE column
Hi all,
maybe just another newbie question.
I've imported a lot of xml documents into an Oracle table with a xmltype column (stored as CLOB). Now I try to select a specific part of these documents and store thsi xml fragment in another table, also in a xmltype column.
Unfortunately this doesn't work, I get ORA-19010: Cannot insert XML fragments.
What can I do to store part of a xml document?
Best regards
MatthiasIs there a way to transform the xml fragments into valid xml documents?
-
Help on how to query 11g table with XMLType column
To all,
We have this table:
DESC MESSAGE
Name Null Type
MESSAGE_ID NOT NULL NUMBER(38)
REQUEST_UU_ID NOT NULL VARCHAR2(50)
MESSAGE_TYPE_CD NOT NULL CHAR(3 CHAR)
EMPLOYEE_NUM NOT NULL VARCHAR2(8)
SEQUENCE_NUM VARCHAR2(20)
REVERSAL_SEQUENCE_NUM VARCHAR2(20)
TRANSACTION_TS TIMESTAMP(6)
MESSAGE_CONTENT_TXT NOT NULL XMLTYPE()
CREATE_BY_NM NOT NULL VARCHAR2(50 CHAR)
CREATE_BY_TS NOT NULL TIMESTAMP(6)
LAST_UPDATE_BY_NM NOT NULL VARCHAR2(50 CHAR)
LAST_UPDATE_BY_TS NOT NULL TIMESTAMP(6)
Given we have multiple columns and one is XMLType how do I query to find rows in the db that match this XPath
Here is a fragment of XML that is held in MESSAGE_CONTENT_TXT XMLType column:
<?xml version="1.0" encoding="UTF-8"?>
<cfg-env:Envelope xmlns="http://www.co.com/schemas/CFX/" xmlns:cfg-env="http://www.co.com/schemas/cfg-env/" xmlns:cfg-hdr="http://www.co.com/schemas/cfg-hdr/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.co.com/schemas/cfg-env/" >
<cfg-env:Header>
<cfg-hdr:MessageHeader xmlns:cfg-hdr="http://www.co.com/schemas/cfg-hdr/" xmlns:cfg-env="http://www.co.com/schemas/cfg-env/" xmlns="http://www.co.com/schemas/CFX/">
<cfg-hdr:Service>
<cfg-hdr:ServiceName>process</cfg-hdr:ServiceName>
<cfg-hdr:MessageType>Request</cfg-hdr:MessageType>
<cfg-hdr:ServiceVersion>1</cfg-hdr:ServiceVersion>
</cfg-hdr:Service>
<cfg-hdr:From>
<cfg-hdr:PartyId>13-175-8724</cfg-hdr:PartyId>
<cfg-hdr:CostCenter>2009065</cfg-hdr:CostCenter>
<cfg-hdr:System>
<cfg-hdr:Application>[email protected]</cfg-hdr:Application>
<cfg-hdr:Version>1.0</cfg-hdr:Version>
<cfg-hdr:Channel>TLR</cfg-hdr:Channel>
</cfg-hdr:System>
<cfg-hdr:OrigReplyToQMgr>QMBKRD01</cfg-hdr:OrigReplyToQMgr>
<cfg-hdr:OrigReplyToQ>Q1</cfg-hdr:OrigReplyToQ>
</cfg-hdr:From>
<cfg-hdr:UserSession>
<cfg-hdr:SignonRole>User</cfg-hdr:SignonRole>
<cfg-hdr:LogonId>R099999</cfg-hdr:LogonId>
I'm trying to find rows in the database that are /Envelope/Header/MessageHeader/UserSession/LogonId/R099999.
Thanks for the assistance. I'm new to XML DB. I appreciate the help.
EricHi Eric,
You can use XMLExists, like this :
select *
from message t
where xmlexists(
'declare namespace env = "http://www.co.com/schemas/cfg-env/"; (: :)
declare namespace hdr = "http://www.co.com/schemas/cfg-hdr/"; (: :)
/env:Envelope/env:Header/hdr:MessageHeader/hdr:UserSession[hdr:LogonId=$id]'
passing t.message_content_txt
, 'R099999' as "id"
); -
Issues with using XMLType indexes against a table with XMLType column
I am attempting to use an XMLIndex with a Structured Component and not having too much luck. Not much data in metalink nor is the documentation very helpful:
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb_indexing.htm#BCGHGIGC
The table DDL is as follows:
CREATE TABLE ECI_SCHEMA.REV_ITEM_EARN_DTL_VIRTUAL(
REV_ITEM_EARN_DTL_ID_NBR NUMBER(16,0) NOT NULL,
UNIQ_MSG_ID_NBR VARCHAR2(50) NOT NULL,
REV_ITEM_BILL_DTL_ID_NBR NUMBER(16,0),
PLAN_RACN_NBR NUMBER(10,0) NOT NULL,
INV_DTL_IMG SYS.XMLType NOT NULL,
NON_INV_DTL_IMG BLOB NOT NULL,
PART_KEY_CD GENERATED ALWAYS AS (MOD(PLAN_RACN_NBR,5)) VIRTUAL,
LAST_UPDT_TMSTP TIMESTAMP(6) NOT NULL,
INV_ID_NBR NUMBER(16,0),
ITEM_STATUS_CD VARCHAR2(1) DEFAULT 'A' NOT NULL
LOB (NON_INV_DTL_IMG) STORE AS NON_IDI_LOB (CHUNK 8192 PCTVERSION 10 CACHE)
TABLESPACE ECI_DATA
PARTITION BY RANGE (PART_KEY_CD)
PARTITION RIED_DAY0_PART
VALUES LESS THAN (1)
TABLESPACE ECI_DATA
PARTITION RIED_DAY1_PART
VALUES LESS THAN (2)
TABLESPACE ECI_DATA
PARTITION RIED_DAY2_PART
VALUES LESS THAN (3)
TABLESPACE ECI_DATA
PARTITION RIED_DAY3_PART
VALUES LESS THAN (4)
TABLESPACE ECI_DATA
PARTITION RIED_MAXVAL_PART
VALUES LESS THAN (MAXVALUE)
TABLESPACE ECI_DATA
XMLTYPE COLUMN "INV_DTL_IMG" STORE AS OBJECT RELATIONAL
XMLSCHEMA "someXdbDocument.xsd"
ELEMENT "revenueInvoice"
According to the documentation, I should be able to create a structured XMLIndex on the XMLType column with the following syntax:
SQL> create index eci_schema.rev_item_earn_dtl_virt_xmlix on eci_schema.rev_item_earn_dtl_virtual
2 (INV_DTL_IMG)
3 INDEXTYPE IS XDB.XMLIndex
4 parameters ('PATH TABLE RIED_PATH_TABLE')
5 local;
When I do this, I get the following error:
create index eci_schema.rev_item_earn_dtl_virt_xmlix on eci_schema.rev_item_earn_dtl_virtual
ERROR at line 1:
ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
ORA-30959: The indexed column is not stored in CLOB.
What am I doing wrong? Based on the Oracle documentation, I was under the impression that 11.2 XMLIndex would work with Object Relational storage. Is this not the case?CREATE INDEX ECI_SCHEMA.REV_ITEM_EARN_DTL_IX7
ON ECI_SCHEMA.REV_ITEM_EARN_DTL
extractValue(inv_dtl_img, '/revenueInvoice/service/transportation/mstrTrkngNbr')
TABLESPACE ECI_REV_ITEM_EARN_DTL_IX7_ITS
LOGGING
PARALLEL(DEGREE 8 INSTANCES 1)
LOCAL
/Elements that occur at most once in each document can be indexed using extractValue(). Despite the fact that the index appears to be a functional index, when we create the index we automatically re-write the create index into a normal btree index on the column that contains the value for the element identified by the xpath.
Eg in the case of a functional index based on extractValue, defined on XMLType using Object relational storage, with an xpath that identifies a node that occurs at most once in each document is not a functional index, it's re-written into a plain old vanilla btree index. You can actually check this by looking in the system tables
Eg
SQL> connect system/oracle
Connected.
SQL> select table_name, index_name from all_indexes where owner = 'OE' and table_name = 'PURCHASEORDER';
TABLE_NAME INDEX_NAME
PURCHASEORDER LINEITEM_TABLE_MEMBERS
PURCHASEORDER ACTION_TABLE_MEMBERS
PURCHASEORDER SYS_C0011037
SQL> alter session set current_schema = OE
2 /
Session altered.
SQL> create unique index PO_REF_INDEX on PURCHASEORDER (extractValue(object_value,'/PurchaseOrder/Reference'));
Index created.
SQL> set lines 250
SQL> select index_name, index_type from all_indexes where owner = 'OE' and table_name = 'PURCHASEORDER';
INDEX_NAME INDEX_TYPE
PO_REF_INDEX NORMAL
LINEITEM_TABLE_MEMBERS NORMAL
ACTION_TABLE_MEMBERS NORMAL
SYS_C0011037 NORMAL
SQL> select * from dba_ind_expressions where table_name = 'PURCHASEORDER' and index_owner = 'OE'
2 /
no rows selectedFrom the above we can see that the index created on extractValue has been re-written in a plain old vanilla BTREE index, and there is no definition for it in dba_ind_expressions So assuming you were able to create the index and insert the data you should find that your index is not a functional index.
] -
How to rename element (node) names in an XMLType column?
I have a source table with a xml data stored in an XMLType column.
The xml contains elements/nodes identified by numbers. I need to replace the numbers with the appropriate names.
The plsql below does this, but has two issues:
i. It selects the data into a clob and does a text replace on the elements in a loop. This works, but is super slow for 3500+ xml rows (about 500 node pairs per row).
ii. Once the data has had the element numbers replaced with the names, it inserts the new xml (clob wrapped in xmltype function) into the table with the XMLType attribute.
The problem with the latter action is that it is failing due to nls client vs server settings, or so it appears from what I could dig up. The actual error message:
ORA-19202: Error occurred in XML processing
LPX-00242: invalid use of ampersand ('&') character (use &)
Error at line 3
There are come entities in the original xml like "" (the degree symbol).
My question is two-fold:
a). Can I replace the element names without straying from the xmltype datatype? If so, how?
b). If I cannot do "a.)", then what must I do ensure that the clob gets converted correctly to xmltype and inserted into the table?
SQL> select <some rows> from nls_database_parameters ;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET WE8ISO8859P1
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.1.0
SQL> SELECT * FROM NLS_SESSION_PARAMETERS;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
----code below-----
(note, this is a stripped down version of the original, so there may be typos)
declare
l_xmlclob CLOB;
l_newxml XMLType;
v_record_uid NUMBER(20);
CURSOR my_cur IS
select a.elementname,b.tagname
from t_elements a, t_tags b
where (a.element_uid = b.element_uid)
begin
select br.xml_data.getClobVal() xml_data into l_xmlclob from t_elements;
FOR my_rec IN my_cur LOOP
l_xmlclob := replace(l_xmlclob,my_cur.elementname,my_cur.maptag_name);
END LOOP;
l_newxml := XMLType(l_xmlclob);
insert into test_translated_xml (xml_data) values (l_newxml);
end;
(hopefully I haven't missed anything)
Any tips or hints would be much appreciated.
Thanks!Hello again,
Take a look at html entity codes: http://www.w3schools.com/tags/ref_entities.asp.
You can use this:
insert into t values (xmltype('<test>'||dbms_xmlgen.convert('this is a test &')||'deg;</test>'));
or
insert into t values (xmltype('<test>'||dbms_xmlgen.convert('this is a test &')||'#176;</test>'));
see this: ° (& deg;) or this: ° (& #176;)
SQL*Plus will not display degree character. But this is valid enitity code, and when you generate HTML out of this, it should be displayed properly in web browser.
HTML is in fact XML, that is validated by specific DTD (Document Type Definition).
Paweł -
How can i change a xmltype column's xml schema?
i create a table that have a xmltype column.this column is schema-based.
my problem is ,
now i want to this column's schema will be redefined to a global schema?
[b]how can i change the column's schema which already have a schema?When a schema is registered a lot of additonal annotations are added to the XML schema by the schema registration process - Look at the version of the XML schema under /sys/schemas/... in the XML DB repository. This information is unqiue to that version of the XML schema and is used internally to manage instance level metadata.
When instance documents are stored in the DB a set of metadata is generated for each document so that we can make sure that we can maintain DOM Fidelity. This metadata is tied directly to the XML schema the document is associated and is only valid in the context of that XML Schema.
So when the schema is registered locally and instances are stored the generated metadata is only valid in the context of the local schema. If the same schema is now registered globally new values will be generated for the annotations applied to the global version of the XML schema. Consequently the metadata associated with a document belonging to the local version of the XML schema has no meaning when viewed in the context of the global version of the XML schema.
The net effect of this is that you will need to copy the data in order to get documents where the metadata for each document is based on the global version of the XML SChema. -
How can I import db column comments into the OBIEE presentation layer?
We have a very well designed data mart - it is a star schema and all the fact and dimension table columns have comments in them with their definition and use. There is virtually no change required in the physical or business layer. The only modifications done in the presentation layer was to hide the Pk/Fk columns.
Is there a way to import these column comments into the presentation layer so that the business user can see this comment in the tool tip while hovering over the presentation column in Answers?
Thanks for your help!Hi,
I assume the comments you mean are stored in user_tab_comments and user_col_comments.
When this is the case you should do the following:
Go to your subject area in your presentation layer. For now I assume the name of this subject area is "Subject Area".
Then right click on this subject area and check "Externalize Descriptions".
Then create an initialization block (session) using this query:
(select 'CD_Subject_Area_' || table_name, comments from user_tab_comments)
union all
(select 'CD_Subject_Area_' || table_name || '_' || column_name, comments from user_col_comments)
Use "Row-wise initialization" for this initialization block.
Two comments:
1) Like I said, I assume Subject Area is the name of your subject area in your presentation layer, so I guess you need to replace this with the name of your Subject Area.
But be sure that you replace each space ' ' with an underscore '_'.
2) Maybe you need to refine above querys by filtering on table_name for those table_names you are using.
Good luck.
Regards,
Stijn -
XMLType column based on XML Schema: several questions
Hi,
I've a table on an oracle db version 10.1.0.4 where I stage the xml files containing orders created on a third party's system using BizTalk.
Although the storage I opted for is based on an XML Schema, defined by this third-party, I am facing big perfomance issues with files bigger than a few hundreds of kBs.
For instance, a 32Mb file takes more than 2 hours to be processed.
Now, after reading other threads in this forum and the documentation, my understanding of the problem is that the whole issue is with the correct indexing of the nested tables.
Here is my current XML Schema definition:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xdb:storeVarrayAsTable="true">
<xs:include schemaLocation="private/Types.xsd"/>
<xs:element name="PickData">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="ProdRun">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="xs:int"/>
<xs:element name="Date" type="string8"/>
<xs:element name="Final" type="xs:int"/>
<xs:element name="PickWave" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="string10"/>
<xs:element name="ProdLine" type="string2"/>
<xs:element name="TourSeq" type="xs:int"/>
<xs:element name="Tour" type="string20"/>
<xs:element name="Customer" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Seq" type="string20"/>
<xs:element name="Cust" type="string10"/>
<xs:element name="Mod" type="string30"/>
<xs:element name="Tod" type="string30"/>
<xs:element name="InvOrder" maxOccurs="unbounded">
<xs:complexType xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="Nr" type="string20"/>
<xs:element name="Item" type="string20"/>
<xs:element name="Qty" type="xs:int"/>
<xs:element name="Priority" type="xs:int"/>
<xs:element name="Reordering" type="xs:int"/>
<xs:element name="DelDate" type="string8"/>
<xs:element name="HlOrder" type="string20"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="InvOrderKey">
<xs:selector xpath="InvOrder"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="CustomerKey">
<xs:selector xpath="Customer"/>
<xs:field xpath="Seq"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="PickWaveKey">
<xs:selector xpath="PickWave"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="ProdRunKey">
<xs:selector xpath="ProdRun"/>
<xs:field xpath="Nr"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Here is the included sub-schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="string2">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string5">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="5"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string6">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="6"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string8">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string10">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string15">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string20">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string30">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string40">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string50">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string250">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="250"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
The statement for creating my table is
CREATE TABLE "XML_ORDERS"
("ID" NUMBER(7,0) NOT NULL ENABLE,
"XMLFILE" "SYS"."XMLTYPE" ,
"INSERTED" DATE DEFAULT sysdate,
CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
XMLSCHEMA "private/PickData.xsd" ELEMENT "PickData"
Here is a simple instance document:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PickData xsi:noNamespaceSchemaLocation="private/PickData.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ProdRun>
<Nr>5</Nr>
<Date>15112005</Date>
<Final>1</Final>
<PickWave>
<Nr>IPW0000017</Nr>
<ProdLine>01</ProdLine>
<TourSeq>1</TourSeq>
<Tour>00000043_078</Tour>
<Customer>
<Seq>5</Seq>
<Cust>100000006</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000457</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000742</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000459</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000742</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>6</Seq>
<Cust>100000013</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000461</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000743</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000463</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000743</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>2</Seq>
<Cust>100000114</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000465</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000744</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000467</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000744</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>3</Seq>
<Cust>100000140</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000469</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000745</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000471</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000745</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>7</Seq>
<Cust>100000143</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000473</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000746</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000475</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000746</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>8</Seq>
<Cust>100000145</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000477</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000747</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000479</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000747</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>9</Seq>
<Cust>100000146</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000481</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000748</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000483</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000748</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>4</Seq>
<Cust>100000147</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000485</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000750</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000487</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000750</HlOrder>
</InvOrder>
</Customer>
<Customer>
<Seq>10</Seq>
<Cust>100000148</Cust>
<Mod>FO</Mod>
<Tod>DDU</Tod>
<InvOrder>
<Nr>IIO0000489</Nr>
<Item>100000036</Item>
<Qty>20</Qty>
<Priority>0</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000751</HlOrder>
</InvOrder>
<InvOrder>
<Nr>IIO0000491</Nr>
<Item>100000045</Item>
<Qty>20</Qty>
<Priority>1</Priority>
<Reordering>0</Reordering>
<DelDate>15112005</DelDate>
<HlOrder>CSO000751</HlOrder>
</InvOrder>
</Customer>
</PickWave>
</ProdRun>
</PickData>
When I registered the XMLSchema, the following types and tables were automatically created and you can see the hierarchy below:
(by the way, I could not find any xdb_utilities.printNestedTables mentioned elsewhere)
XML_ORDERS
|_PickData381_T
|___ProdRun382_T
|_____PickWave388_COLL
|_______PickWave383_T
|_________Customer387_COLL
|___________Customer384_T
|_____________InvOrder386_COLL
These objects are then used in the following nested tables:
TABLE_NAME TABLE_TYPE_NAME PARENT_TABLE_NAME PARENT_TABLE_COLUMN
SYS_NTaK/5zar5S0WitSsgu6OKPQ== PickWave388_COLL PickData389_TAB "XMLDATA"."ProdRun"."PickWave"
SYS_NTf6QvwVm8SFKz+K/YYWq+WQ== Item408_COLL ProdData409_TAB "XMLDATA"."Item"
SYS_NTtu05ilrRQqmuEN4k+07VDA== Customer402_COLL OutboundParty403_TAB "XMLDATA"."Customer"
SYS_NTK6fhWq5uTJ+vKcgBpNm1Fg== InvOrder386_COLL SYS_NTIIzv7bkXQSSS43igtfi5eg== InvOrder
SYS_NTIIzv7bkXQSSS43igtfi5eg== Customer387_COLL SYS_NTaK/5zar5S0WitSsgu6OKPQ== Customer
I enabled sql tracing and I got the following TKPROF output
INSERT INTO IMP_ORDERS (PICK_INVORDERNR, PICK_ITEM, PICK_QTY, PICK_PRIORITY,
PICK_REORDERING, PICK_HLORDER, PICK_DELDATE, PICK_CUST, PICK_MOD, PICK_TOD,
PICK_SEQ, PICK_PICKWAVENR, PICK_PICKWAVEPRODLINE, PICK_PICKWAVETOUR,
PICK_PICKWAVETOURSEQ, PICK_ORDKEY, PICK_RUNKEY) SELECT INVORDERNR, ITEM,
QTY, PRIORITY, REORDERING, HLORDER, DELDATE, CUST, MOD, TOD, SEQ,
PICKWAVENR, PICKWAVEPRODLINE, PICKWAVETOUR, PICKWAVETOURSEQ, ROWNUM AS
PICK_ORDKEY, PRODRUNID FROM (SELECT /*+ cardinality(g 15)*/
EXTRACTVALUE(VALUE(G), '/InvOrder/Nr') AS INVORDERNR, EXTRACTVALUE(VALUE(G),
'/InvOrder/Item') AS ITEM, EXTRACTVALUE(VALUE(G), '/InvOrder/Qty') AS QTY,
EXTRACTVALUE(VALUE(G), '/InvOrder/Priority') AS PRIORITY,
EXTRACTVALUE(VALUE(G), '/InvOrder/Reordering') AS REORDERING,
EXTRACTVALUE(VALUE(G), '/InvOrder/HlOrder') AS HLORDER,
TO_DATE(EXTRACTVALUE(VALUE(G), '/InvOrder/DelDate'),'DDMMYYYY') AS DELDATE,
F.CUST, F.MOD, F.TOD, F.SEQ, F.PICKWAVENR, F.PICKWAVEPRODLINE,
F.PICKWAVETOUR, F.PICKWAVETOURSEQ, F.PRODRUNNR, F.PRODRUNDATE,
F.PRODRUNFINAL, F.PRODRUNID FROM (SELECT /*+ cardinality(e 60)*/VALUE(E) AS
CUSTOMERNODE, EXTRACTVALUE(VALUE(E), '/Customer/Cust') AS CUST,
EXTRACTVALUE(VALUE(E), '/Customer/Mod') AS MOD, EXTRACTVALUE(VALUE(E),
'/Customer/Tod') AS TOD, TO_NUMBER(EXTRACTVALUE(VALUE(E), '/Customer/Seq'))
AS SEQ, D.PICKWAVENR, D.PICKWAVEPRODLINE, D.PICKWAVETOUR, D.PICKWAVETOURSEQ,
D.PRODRUNNR, D.PRODRUNDATE, D.PRODRUNFINAL, D.PRODRUNID FROM (SELECT /*+
cardinality(c 100)*/VALUE(C) AS PICKWAVENODE, EXTRACTVALUE(VALUE(C),
'/PickWave/Nr') AS PICKWAVENR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
'/PickWave/ProdLine')) AS PICKWAVEPRODLINE, EXTRACTVALUE(VALUE(C),
'/PickWave/Tour') AS PICKWAVETOUR, TO_NUMBER(EXTRACTVALUE(VALUE(C),
'/PickWave/TourSeq')) AS PICKWAVETOURSEQ, A.PRODRUNNR, A.PRODRUNDATE,
A.PRODRUNFINAL, A.PRODRUNID FROM (SELECT /*+ cardinality(b 1)*/VALUE(B) AS
PRODRUNNODE, EXTRACTVALUE(VALUE(B), '/ProdRun/Nr') AS PRODRUNNR,
TO_DATE(EXTRACTVALUE(VALUE(B), '/ProdRun/Date'),'DDMMYYYY') AS PRODRUNDATE,
EXTRACTVALUE(VALUE(B), '/ProdRun/Final') AS PRODRUNFINAL, X.ID PRODRUNID
FROM XML_ORDERS X, TABLE(XMLSEQUENCE(EXTRACT(X.XMLFILE,'/PickData/ProdRun'))
) B WHERE X.ID = :B1 ) A, TABLE(XMLSEQUENCE(EXTRACT(A.PRODRUNNODE,
'/ProdRun/PickWave'))) C ) D, TABLE(XMLSEQUENCE(EXTRACT(D.PICKWAVENODE,
'/PickWave/Customer'))) E ) F, TABLE(XMLSEQUENCE(EXTRACT(F.CUSTOMERNODE,
'/Customer/InvOrder'))) G ORDER BY PICKWAVEPRODLINE, PICKWAVETOURSEQ,
PICKWAVENR, SEQ )
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 4324.09 9994.65 0 57193 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 4324.09 9994.65 0 57193 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 68 (recursive depth: 1)
Rows Row Source Operation
0 COUNT (cr=0 pr=0 pw=0 time=180 us)
0 VIEW (cr=0 pr=0 pw=0 time=166 us)
0 SORT ORDER BY (cr=0 pr=0 pw=0 time=152 us)
40866 NESTED LOOPS (cr=54973 pr=0 pw=0 time=31065606 us)
1363 NESTED LOOPS (cr=54937 pr=0 pw=0 time=11037183 us)
1 NESTED LOOPS (cr=54889 pr=0 pw=0 time=10145883 us)
1 NESTED LOOPS (cr=54841 pr=0 pw=0 time=9799012 us)
1 TABLE ACCESS BY INDEX ROWID XML_ORDERS (cr=2 pr=0 pw=0 time=222 us)
1 INDEX UNIQUE SCAN XML_ORDERS_PK (cr=1 pr=0 pw=0 time=126 us)(object id 58551)
1 COLLECTION ITERATOR PICKLER FETCH (cr=54839 pr=0 pw=0 time=9798748 us)
1 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=346818 us)
1363 COLLECTION ITERATOR PICKLER FETCH (cr=48 pr=0 pw=0 time=870830 us)
40866 COLLECTION ITERATOR PICKLER FETCH (cr=36 pr=0 pw=0 time=18739302 us)
Note that I cancelled this operation before it was over so I imagine that these figures refer to the statistics as of the time when the operation was interrupted.
So, here are finally my questions.
In order to create the constraints on the nested tables as shown in other threads, do I need to drop the existing xml_orders table and ancillary object types and recreate them or is there a way to add such constraints using the existing system generated object names?
Secondly, the xml_orders table may contain severale documents, not just one and his current primary key is the column ID. So, in order to uniquely identify the deepest element in the xml document, I need first to select the relevant document by means of the id column.
Would it be better to create the indexes containing this id column together with the nested_table_id and array_index?
Thanks for you help.
Flavio
PS: I wrote a 10 lines xsl transformation that I passed on to Saxon together with the 32Mb file. It took less than 1 minute to produce a flat file that was loaded almost instantly by SQL*Loader. So, what I am looking for is a procedure loading this stuff in less than 2 minutes or possibly less.Does the following help
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:53 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool registerSchema_&4..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/xsd/&4',
5 bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/xsd/&4',
new 4: result := dbms_xdb.createResource('/home/OTNTEST/xsd/GetaxTypes.xsd',
old 5: bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'GetaxTypes.xsd'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
SQL> commit
2 /
Commit complete.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaURL => '&3',
5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => &5
10 );
11 end;
12 /
old 4: schemaURL => '&3',
new 4: schemaURL => 'private/GetaxTypes.xsd',
old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/GetaxTypes.xsd').getClob(),
old 9: genTables => &5
new 9: genTables => TRUE
PL/SQL procedure successfully completed.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:55 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool registerSchema_&4..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> declare
2 result boolean;
3 begin
4 result := dbms_xdb.createResource('/home/&1/xsd/&4',
5 bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
6 end;
7 /
old 4: result := dbms_xdb.createResource('/home/&1/xsd/&4',
new 4: result := dbms_xdb.createResource('/home/OTNTEST/xsd/PickData.xsd',
old 5: bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
new 5: bfilename(USER,'PickData.xsd'),nls_charset_id('AL32UTF8'));
PL/SQL procedure successfully completed.
SQL> commit
2 /
Commit complete.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaURL => '&3',
5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
6 local => TRUE,
7 genTypes => TRUE,
8 genBean => FALSE,
9 genTables => &5
10 );
11 end;
12 /
old 4: schemaURL => '&3',
new 4: schemaURL => 'private/PickData.xsd',
old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/PickData.xsd').getClob(),
old 9: genTables => &5
new 9: genTables => TRUE
PL/SQL procedure successfully completed.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:58 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool createTable.log
SQL> --
SQL> connect &1/&2
Connected.
SQL> --
SQL> CREATE TABLE "XML_ORDERS"
2 ("ID" NUMBER(7,0) NOT NULL ENABLE,
3 "XMLFILE" "SYS"."XMLTYPE" ,
4 "INSERTED" DATE DEFAULT sysdate,
5 CONSTRAINT "XML_ORDERS_PK" PRIMARY KEY ("ID") USING INDEX ENABLE
6 ) XMLTYPE COLUMN XMLFILE STORE AS OBJECT RELATIONAL
7 XMLSCHEMA "private/PickData.xsd"
8 ELEMENT "PickData"
9 VARRAY XMLFILE."XMLDATA"."ProdRun"."PickWave" STORE AS TABLE PickWave_TAB
10 (
11 ( primary key (nested_table_id, array_index)
12 ) organization index overflow
13 VARRAY "Customer" STORE AS TABLE Customer_TAB
14 (
15 (primary key (nested_table_id, array_index)
16 ) organization index overflow
17 VARRAY "InvOrder" STORE AS TABLE InvOrder_TAB
18 (
19 (primary key (nested_table_id, array_index)
20 ) organization index overflow
21 )
22 )
23 )
24 /
Table created.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool insertFile_&3..log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> --
SQL> insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
2 /
old 1: insert into XML_ORDERS (ID, XMLFILE) values (&4, xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
new 1: insert into XML_ORDERS (ID, XMLFILE) values (10, xmltype(bfilename(USER,'testcase.xml'),nls_charset_id('AL32UT
8')))
1 row created.
Elapsed: 00:00:00.11
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.01
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 27 21:44:59 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> spool testcase.log
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> set pages 0 lines 140
SQL> --
SQL> -- Testcase code here
SQL> --
SQL> set autotrace on explain
SQL> --
SQL> create or replace view PROD_RUN_VIEW
2 (
3 PRODRUNNODE,
4 PRODRUNNR,
5 PRODRUNDATE,
6 PRODRUNID,
7 PRODRUNFINAL
8 )
9 as
10 select EXTRACT(XMLFILE,'/PickData/ProdRun'),
11 EXTRACTVALUE(XMLFILE , '/PickData/ProdRun/Nr'),
12 TO_DATE(EXTRACTVALUE(XMLFILE, '/PickData/ProdRun/Date'),'DDMMYYYY'),
13 ID,
14 EXTRACTVALUE(XMLFILE,'/PickData/ProdRun/Final')
15 from XML_ORDERS
16 /
View created.
Elapsed: 00:00:00.09
SQL> create or replace view PICK_WAVE_VIEW
2 (
3 PICKWAVENODE,
4 PICKWAVENR,
5 PICKWAVEPRODLINE,
6 PICKWAVETOUR,
7 PICKWAVETOURSEQ,
8 PRODRUNNR,
9 PRODRUNDATE,
10 PRODRUNID,
11 PRODRUNFINAL
12 )
13 as
14 select value(PW),
15 extractValue(value(PW),'/PickWave/Nr'),
16 TO_NUMBER(EXTRACTVALUE(value(PW),'/PickWave/ProdLine')),
17 extractValue(value(PW),'/PickWave/Tour'),
18 TO_NUMBER(extractValue(value(PW),'/PickWave/TourSeq')),
19 PRODRUNNR,
20 PRODRUNDATE,
21 PRODRUNID,
22 PRODRUNFINAL
23 FROM PROD_RUN_VIEW, table(xmlsequence(extract(PRODRUNNODE,'/ProdRun/PickWave'))) PW
24 /
View created.
Elapsed: 00:00:00.09
SQL> create or replace view CUSTOMER_VIEW
2 (
3 CUSTOMERNODE,
4 CUST,
5 MOD,
6 TOD,
7 SEQ,
8 PICKWAVENR,
9 PICKWAVEPRODLINE,
10 PICKWAVETOUR,
11 PICKWAVETOURSEQ,
12 PRODRUNNR,
13 PRODRUNDATE,
14 PRODRUNFINAL,
15 PRODRUNID
16 )
17 as
18 select value(CUST),
19 EXTRACTVALUE(VALUE(CUST), '/Customer/Cust'),
20 EXTRACTVALUE(VALUE(CUST), '/Customer/Mod'),
21 EXTRACTVALUE(VALUE(CUST), '/Customer/Tod'),
22 TO_NUMBER(EXTRACTVALUE(VALUE(CUST), '/Customer/Seq')),
23 PICKWAVENR,
24 PICKWAVEPRODLINE,
25 PICKWAVETOUR,
26 PICKWAVETOURSEQ,
27 PRODRUNNR,
28 PRODRUNDATE,
29 PRODRUNFINAL,
30 PRODRUNID
31 from PICK_WAVE_VIEW, table(xmlsequence(extract(PICKWAVENODE,'/PickWave/Customer'))) CUST
32 /
View created.
Elapsed: 00:00:00.10
SQL>
SQL> create or replace view INVOICE_ORDER_VIEW
2 (
3 INVORDERNR,
4 ITEM,
5 QTY,
6 PRIORITY,
7 REORDERING,
8 HLORDER,
9 DELDATE,
10 CUST,
11 MOD,
12 TOD,
13 SEQ,
14 PICKWAVENR,
15 PICKWAVEPRODLINE,
16 PICKWAVETOUR,
17 PICKWAVETOURSEQ,
18 PRODRUNNR,
19 PRODRUNDATE,
20 PRODRUNFINAL,
21 PRODRUNID
22 )
23 as
24 SELECT EXTRACTVALUE(VALUE(INV), '/InvOrder/Nr'),
25 EXTRACTVALUE(VALUE(INV), '/InvOrder/Item'),
26 EXTRACTVALUE(VALUE(INV), '/InvOrder/Qty'),
27 EXTRACTVALUE(VALUE(INV), '/InvOrder/Priority'),
28 EXTRACTVALUE(VALUE(INV), '/InvOrder/Reordering'),
29 EXTRACTVALUE(VALUE(INV), '/InvOrder/HlOrder'),
30 TO_DATE(EXTRACTVALUE(VALUE(INV), '/InvOrder/DelDate'),'DDMMYYYY'),
31 CUST,
32 MOD,
33 TOD,
34 SEQ,
35 PICKWAVENR,
36 PICKWAVEPRODLINE,
37 PICKWAVETOUR,
38 PICKWAVETOURSEQ,
39 PRODRUNNR,
40 PRODRUNDATE,
41 PRODRUNFINAL,
42 PRODRUNID
43 FROM CUSTOMER_VIEW, table(xmlsequence(extract(CUSTOMERNODE,'Customer/InvOrder'))) INV
44 /
View created.
Elapsed: 00:00:00.13
SQL> select * from INVOICE_ORDER_VIEW
2 /
IIO0000461 100000036 20 1 0 CSO000743 15-NOV-05 100000013
FO DDU 6 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000463 100000045 20 1 0 CSO000743 15-NOV-05 100000013
FO DDU 6 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000473 100000036 20 1 0 CSO000746 15-NOV-05 100000143
FO DDU 7 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000475 100000045 20 1 0 CSO000746 15-NOV-05 100000143
FO DDU 7 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000469 100000036 20 1 0 CSO000745 15-NOV-05 100000140
FO DDU 3 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000471 100000045 20 1 0 CSO000745 15-NOV-05 100000140
FO DDU 3 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000489 100000036 20 0 0 CSO000751 15-NOV-05 100000148
FO DDU 10 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000491 100000045 20 1 0 CSO000751 15-NOV-05 100000148
FO DDU 10 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000481 100000036 20 0 0 CSO000748 15-NOV-05 100000146
FO DDU 9 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000483 100000045 20 1 0 CSO000748 15-NOV-05 100000146
FO DDU 9 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000485 100000036 20 0 0 CSO000750 15-NOV-05 100000147
FO DDU 4 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000487 100000045 20 1 0 CSO000750 15-NOV-05 100000147
FO DDU 4 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000457 100000036 20 1 0 CSO000742 15-NOV-05 100000006
FO DDU 5 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000459 100000045 20 1 0 CSO000742 15-NOV-05 100000006
FO DDU 5 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000477 100000036 20 1 0 CSO000747 15-NOV-05 100000145
FO DDU 8 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000479 100000045 20 1 0 CSO000747 15-NOV-05 100000145
FO DDU 8 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000465 100000036 20 1 0 CSO000744 15-NOV-05 100000114
FO DDU 2 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
IIO0000467 100000045 20 1 0 CSO000744 15-NOV-05 100000114
FO DDU 2 IPW0000017 1 00000043_078
1
5 15-NOV-05 1 10
18 rows selected.
Elapsed: 00:00:00.22
Execution Plan
Plan hash value: 1730223965
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 18 | 10278 | 877 (0)| 00:00:11 |
| 1 | NESTED LOOPS | | 18 | 10278 | 877 (0)| 00:00:11 |
| 2 | NESTED LOOPS | | 18 | 8424 | 841 (0)| 00:00:11 |
| 3 | MERGE JOIN CARTESIAN | | 18 | 4680 | 805 (0)| 00:00:10 |
| 4 | TABLE ACCESS FULL | XML_ORDERS | 1 | 67 | 3 (0)| 00:00:01 |
| 5 | BUFFER SORT | | 18 | 3474 | 802 (0)| 00:00:10 |
| 6 | INDEX FAST FULL SCAN| SYS_IOT_TOP_64187 | 18 | 3474 | 802 (0)| 00:00:10 |
|* 7 | INDEX UNIQUE SCAN | SYS_IOT_TOP_64185 | 1 | 208 | 2 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | SYS_C008783 | 1 | | 0 (0)| 00:00:01 |
|* 9 | INDEX UNIQUE SCAN | SYS_IOT_TOP_64183 | 1 | 103 | 2 (0)| 00:00:01 |
|* 10 | INDEX RANGE SCAN | SYS_C008785 | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
7 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
8 - access("NESTED_TABLE_ID"="CUSTOMER_TAB"."SYS_NC0000800009$")
9 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
filter("NESTED_TABLE_ID"="XML_ORDERS"."SYS_NC0001000011$")
10 - access("NESTED_TABLE_ID"="PICKWAVE_TAB"."SYS_NC0000800009$")
Note
- dynamic sampling used for this statement
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
C:\oracle\xdb\otn\347125>You were sequencing the ProdRun node, which is a mistake. Only nodes which occur multiple times should be sequenced... -
What is default size of XMLType column?
I have a table with 1 raw type and 1 XMLType column. In the XMLType column I am inserting following XML,
<ocaStatus xmlns="http://xmlbeans.apache.org/ocastatus">
<status>
<statusCode>990</statusCode>
<statusDateclass="sql-date">2010-01-19</statusDate>
<userId>OcaNimsAcf</userId>
<comment>DocumentnotinNIMS</comment>
</status>
<status>
<statusCode>990</statusCode>
<statusDateclass="sql-date">2010-01-19</statusDate>
<userId>OcaNimsAcf</userId>
<comment>DocumentnotinNIMS</comment>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-09-16</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-09-16</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-09-16</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-29</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-29</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-28</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-28</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-27</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-26</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-25</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-20</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-20</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-20</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>306</statusCode>
<statusDateclass="sql-date">2008-04-21</statusDate>
<userId>u0075970</userId>
</status>
<status>
<statusCode>301</statusCode>
<statusDateclass="sql-date">2008-02-05</statusDate>
<userId>DMS_WORKFLOW</userId>
<comment></comment>
</status>
<status>
<statusCode>990</statusCode>
<statusDateclass="sql-date">2010-01-17</statusDate>
<userId>OcaNimsAcf</userId>
<comment>Comparedfornimsacf</comment>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-09-16</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-09-16</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-09-16</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-29</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-29</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-28</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-28</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-27</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-26</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-25</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-22</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-21</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-20</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-20</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>501</statusCode>
<statusDateclass="sql-date">2008-08-20</statusDate>
<userId>oca_scheduled_job</userId>
</status>
<status>
<statusCode>306</statusCode>
<statusDateclass="sql-date">2008-04-21</statusDate>
<userId>u0075970</userId>
</status>
<status>
<statusCode>301</statusCode>
<statusDateclass="sql-date">2008-02-05</statusDate>
<userId>DMS_WORKFLOW</userId>
<comment></comment>
</status>
</ocaStatus>
The xml is very long. For inserting into the table I am using xmlparse() function to get XMLType.
While doing this I am getting ORA-01704: string literal too long error. It says can accommodate at the most 4000 characters.
I guess XMLType is stored as a CLOB by default.So it should allow more than 4000 characters.
How can I store xml with more than 4000 characters.
Thanks.XMLParse is a SQL function, so you can't use a string literal longer than 4000 chars.
Instead, you may declare a PL/SQL VARCHAR2 variable, which can hold up to 32k characters, and then use the XMLType constructor :
DECLARE
xmlstr VARCHAR2(32767) := '<xml string here>';
xmldoc xmltype;
BEGIN
xmldoc := xmltype(xmlstr);
INSERT INTO your_table(xml_data) VALUES(xmldoc);
END;For strings longer than 32k, you'll probably have to load it from a file.
Maybe you are looking for
-
My husband originally bought the Scrabble app for his iPhone. I downloaded it onto my iPad and used it, successfully, for 1 day. Since then, when I try to open it, it starts to load and then shuts down and goes back to the main screen. PLEASE, someon
-
No clue what to do..
-
Quicktime 7.1.3 and iTunes won't open .mp4 movies
Both my PowerMac G4 and MacBook will not open mp4 files in quicktime anymore. After updating both programs movies that used to play now will not play nor import into the itunes library. Quicktime gives an error "the movie could not be opened"
-
Application Loader Error ITMS-90125
When i try to send my multi-folio app to store using application loader, i get "ERROR ITMS-90125 "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This
-
Approval process not waiting for approval tasks to be completed
Hi All, I created an Approval process for a resource. When a request is created for this resource an approval task is assigned to the manager of the user. Before the approval task is completed by the manager the resource is getting provisioned. Is th