How to link a XMLType table to a repository?
I follow following steps:
1) register a schema and generate a default table
2) insert XML documents ( specifing the schema just registered) into the table by using SQL
But how to let those XML documents show up in the repository so that users can access to them by using HTTP/FTP so that any update done to the table will be reflected in the repository and vice versa.
I tried many things but no luck.
Everything looks OK to me. In the folllowing example the createResource() is the equivilant of the WebDAV copy. Do you have multiple database instances running on the server machine. It is possible that the WebDAV connection is connected to another database instance.
What folder are you copying the data into
Can you do
select path from path_view where under_path(res,'/targetFolderForWebDav') = 1
SQL>
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'http://localhost:8090/CMDEMO/fullname.xsd';
3 :schemaPath := '/public/testcase.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<?xml version="1.0"?>
5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
6 <xs:element name="fullName" type="xs:string" xdb:defaultTable="FULL_NAME_TABLE"/>
7 </xs:schema>
8 ');
9 begin
10 if (dbms_xdb.existsResource(:schemaPath)) then
11 dbms_xdb.deleteResource(:schemaPath);
12 end if;
13 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
14 end;
15 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> desc FULL_NAME_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://localhost:8090/CMDEMO/fullname.xsd" Element "fullName")
SQL> --
SQL> set long 100000 lines 150
SQL> --
SQL> select *
2 from FULL_NAME_TABLE
3 /
no rows selected
Execution Plan
Plan hash value: 3651065813
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 2022 | 2 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| FULL_NAME_TABLE | 1 | 2022 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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-properties/><read-contents/></privilege>'))=1)
Note
- dynamic sampling used for this statement
SQL> declare
2 res boolean;
3 docPath varchar2(40) := '/public/testcase.xml';
4 xmldata xmlType := xmlType(
5 '<fullName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xsi:noNamespaceSchemaLocation="http://localhost:8090/CMDEMO/fullname.xsd">
7 David King
8 </fullName>');
9 begin
10 if (dbms_xdb.existsResource(docPath)) then
11 dbms_xdb.deleteResource(docpath);
12 end if;
13 res := dbms_xdb.createResource(docPath,xmldata);
14 end;
15 /
PL/SQL procedure successfully completed.
SQL> select *
2 from FULL_NAME_TABLE
3 /
SYS_NC_ROWINFO$
<fullName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://localhost:8090/CMDEMO/fullname.xsd">
David King
</fullName>
Execution Plan
Plan hash value: 3651065813
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 2022 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| FULL_NAME_TABLE | 1 | 2022 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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-properties/><read-contents/></privilege>'))=1)
Note
- dynamic sampling used for this statement
SQL>
SQL>
SQL>
SQL>
Similar Messages
-
I am using a xmltype table for parsing the xml file and then storing the tag values into someother tables.
The table syntax
CREATE GLOBAL TEMPORARY TABLE ATLAS.XML_PROCESS
XML_DATA XMLTYPE
ON COMMIT DELETE ROWS;
At a time i will parse only one xml file. And them the content will be deleted and then i will parse another xml file.
The parsing of the xml file is taking much CPU time and also it is taking more FETCH time. ( i have seen from the trace file)
Do i need to create any index on this table?
Please suggest me how can i imrove the performence.
ThanksHi
Why do you use a GTT? Just keep your xml in memory...
HTH
Chris -
Hi,
I have a requirement to extract the data from the transaction FBL1N ( i.e. from BSIK & BSAK) to get the details of XBLNR-Reference Document & WRBTR-Amount in Document Currency to display in the MM-Purchasing reports. In MM-Purchasing tables we are using ( EKKO, EKPO, EKBE) tables. Bothe FBL1N & the MM-Purchasing custom report runs based on Vendor & Company code.
Please provide how to link these two.
Regards,
Kiran.LHi,
You can link the two tables using joins.
Here's one simple example.
Select matnr ersda mtart maktx into corresponding fields of table itab1 from mara as a inner join makt as b on amatnr = bmatnr.
If you want to use outer join use outer join in place of inner join.
Hope its helpful.
Reward points if found helpful...
Cheers,
Chandra Sekhar. -
How to 'DESCRIBE' a XMLType table
Hi,
When I describe a XMLType table, the output is truncated as follow :
SQL> desc scott.purchaseorder
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://localhost:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" Ele
Is there any way to show the complete string ?
I have tried 'SET LONG' and 'SET LINESIZE', but not succeeded.
Any suggestion ?I've also found under windows that using sqlplus within a command window gives better results with wrapping text than using sqlplusw (the gui version). Also Oracle are deprecating sqlplusw in favour of the SQL worksheet in enterprise manager from version 10 onwards, although it does still get installed at the moment if you really want to keep using it.
Regards -
How to link Azure database tables and fields to VS2012 C++ entry form
We are using Visual Studio 2012 C++ and have successfully connected to the database on Azure, but do no know how to associate the database tables and fields with the C++ application data entry forms. Can anyone help? Thanks
Hello Roxanne,
You could use Entity framework to map classes to Azure tables. Please refer http://www.codeproject.com/Articles/363040/An-Introduction-to-Entity-Framework-for-Absolute-B to
learn more. Hope this helps.
Regards,
Kumar Bijayanta -
How to link two fact table in OBIEE
i experts
1. I have one fact table EXCHANGE_FACT(Contains the exchange rate for each curruncy on each day) .
2. I Have anothe fact Table ACCOUNT_FACT(Contains Amount for each currency on each day).
Now i have to link these two table on bace of currency_key and time_key in OBIEE. so i have can i achieve it in OBIEE.
Regards
FrndsHi Frnds,
You should create two common dimensions (currency en time) and join each fact table seperately to these dimension. Create a demnsion (hierarchy) for each dimension.
Good Luck,
Daan Bakboord
Scamander Solutions -
Post Author: strife
CA Forum: General
I am using Crystal 10 and trying to develop a donor percent participation report, comparing donors to total number of class members (donors per class/good addresses per class) * 100. The number of class members comes from a summary table of good address counts that remains static throughout the year.
1) I can create a view for the good address counts but Iu2019m unclear as to the way to link this view to the table of donors. I canu2019t link ID to ID since itu2019s a summary and doesnu2019t have a row per ID (I need address counts for ALL IDs not just the ones who are donors).
2) If I put the view in a subreport, I get only one result not a count for each group which is class year.
3) If I put the subreport in the class year group to get a result returned for each class but the subreport creates unwanted blank rows in the export to Excel.
I am looking at the last option but wonder if there is some other way that Iu2019m overlooking. Any help is appreciated.Here is the video! and it works for 2010. It shows you how to put the pivot wizard that you need on the ribbon.
https://www.youtube.com/watch?v=pUXJLzqlEPk
Excel Pivot Tables: How to flatten a cross tab table
Note: the above instructions for 2007 and 2003 work as well BUT you must let go of the "alt" & "d" when you press "P"! -
How to check a XMLTYPE table for corrupted (not invalid!) XML records ??
Hello,
I'd like to get help on the following issue, please. I need to check the XML data in a number of tables with XMLTYPE data type. Some of the data is corrupted but in terms not that the XML format is wrong but there is no XML at all in the fields but just only, for example, control characters (no tags, no anything, just corrupted data).
So, I have made a PL/SQL procedure cursor to get all the tables from a list, and then another cursor inside to browse each table for corrupted records. But can you help me how to check this? Any of the XML functions like for example: XMLIsValid, isFragment(), getrootelement(), etc. return to me an Oracle error "ORA-31011 XML parsing failed" and the procedure gets stuck on the first found bad record. But I need to continue and check all of them. Is it possible to get the ORA-31011 error with EXCEPTION, write to a logging table the corrupted record ID, and then continue?
Here is my simple procedure:
CREATE OR REPLACE PROCEDURE CHECKXML (v_schema in VARCHAR2)
IS
v_Message VARCHAR2(254);
sql_stmt1 VARCHAR2(1000);
sql_stmt2 VARCHAR2(1000);
c1 SYS_REFCURSOR;
c2 SYS_REFCURSOR;
cur_tab varchar2(100);
cur_appl varchar2(100);
cur_rec varchar2(200);
valid_flag number;
criteria VARCHAR2(20);
tab1 VARCHAR2(20);
tab2 VARCHAR2(20);
BEGIN
criteria := 'XMLTYPE';
sql_stmt1 := 'select id, path from ' || v_schema || '.stubfiles where type=:bcriteria';
open c1 for sql_stmt1 using criteria;
loop
begin
fetch c1 into cur_tab, cur_appl;
exit when c1%notfound;
insert into system.log_table values (sysdate, v_schema, 'next table', 'id ' || cur_tab, 'appl ' || cur_appl, '');
sql_stmt2 := 'select t.recid, t.xmlrecord.isFragment() from ' || v_schema || '.' || cur_tab || ' t';
open c2 for sql_stmt2;
loop
begin
fetch c2 into cur_rec, valid_flag;
exit when c2%notfound;
insert into system.log_table values (sysdate, v_Schema, 'next record', 'id ' || cur_tab, 'recid ' || cur_rec, 'valid ' || valid_flag);
commit;
EXCEPTION
WHEN OTHERS THEN v_Message := sqlerrm;
dbms_output.put_line('Error for ' || cur_tab);
dbms_output.put_line('-' || v_Message);
insert into system.log_table values (sysdate, cur_tab, 'id err' || c_Row.ID,'appl err' || c_Row.path, v_Message,'');
end;
end loop;
close c2;
commit;
end;
end loop;
close c1;
commit;
END CHECKXML;
Thanks in advance
EvgeniHi
Why do you use a GTT? Just keep your xml in memory...
HTH
Chris -
How to link oracle dba_users table with SQL's sysusers and syslogin tables?
I need to validate that the username present in the Oracle's dba_users table is the same as SQL's sysusers's isNTUSER and syslogin's name columns. How to achieve this? Someone please help me out. Thanks.
refer these three link for information.
http://www.oracleappshub.com/release12/r12-sla-analyzing-subledger-accounting/
http://www.oracleappshub.com/release12/r12-sla-from-product-accounting-to-subledger-accounting/
http://www.oracleappshub.com/release12/know-the-changes-because-of-r12-oracle-payment-module-fund-disbursement-in-ebs/ -
How to link a fact table to one dimension many times
I have fact table which contains four date fields and I want to connect all of them to the Time dimension. I think I probably must split this fact table to multiple tables and then link them to dimensions. What is the right way to solve this kind of problem?
Example: Fact table: TimeIn, TimOut, TimeStart, TimeStop, InPlace, OutPlace, StartPlace, StopPlace, Speed, Weight, Width, Height .....
Thank youHello Kostis,
thank you for your answer. I don't fully understand you. Can you show me short example, please? I create alias table for time dimension on Physical Layer - original table is TimeDayDim and I create aliases TimeDayDim1, TimeDayDim2, TimeDayDim3, TimeDayDim4. Then I create foreign key Fact.Time1 -> TimeDayDim1, Fact.Time2 -> TimeDayDim2, Fact.Time3 -> TimeDayDim3, Fact.Time4 -> TimeDayDim4. And what now? Must I create these table api Bussines Model and create new time dimensions at bussiness model????
I need in Answers ONE Time dimension. I think I must split my fact table to four tables ... (time1, place1 ...) (time2, place2 ...) (time3 place3...) (time4 place4...) then link those tables to Time dimension (but I dont know where I can split those tables - on Physical Layer or on Bussines Layer).
I suppose that I will have in Answers one time dimension and four facts tables and I will be able to query them. (for example: Time.Days, Fact1.Place1, Fact3.Speed, Fact4.Count Criteria: Time.Year = 2008)
Best Regards Vlada -
How to link between these tables and get the bom explosion
tables : mast,stpo,makt
SELECT AMATNR BMAKTX CIDNRK CMENGE C~MEINS INTO CORRESPONDING FIELDS OF TABLE IT_COMP_IDEL FROM
MAST AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR
INNER JOIN STPO AS C ON ASTLNR = CSTLNR
WHERE AMATNR IN S_MATNR AND AWERKS IN S_WERKS.
using cs13 to get the bom summary
using these table to but i got only few materials only,
but cs13 got more materials
how can i solve that one
Regards
dsHi,
Just go through this program i think it will help u out.
TABLES: MARA, MARC.
TYPE-POOLS : fibs,stree.
TYPES: BEGIN OF STRUCT_BOM,
MATNR TYPE MATNR, " Material Number
WERKS TYPE WERKS_D, " Plant
IDNRK TYPE IDNRK, " BOM Item
STLAL TYPE STLAL, " Alternative BOM
STUFE TYPE HISTU, " BOM Level
OJTXB TYPE OJTXB, " Object description (assembly)
END OF STRUCT_BOM.
*- table types
types: t_bom type table of struct_bom.
*Internal Tables to hold the BOM data.
DATA: ITAB_BOM type table of STRUCT_BOM.
DATA: WA_BOM TYPE STRUCT_BOM,
wa_stb type stpox,
wa_matcat type stpox.
DATA: IT_STB type standard table of STPOX,
IT_STBC type standard table of STPOX,
IT_MATCAT type standard table of CSCMAT.
*-- to enter BOM DATA
*Selection Options
select-options: s_matnr for V_matnr, "BOM Material
s_plant for V_werks. "BOM Plant
*Input Parameters
parameters: p_alter type stko-stlal, "Alternate BOM
p_usage type stzu-stlan, "BOM usage
p_appli type tc04-capid, "BOM Application
P_CATE TYPE STKO-STLTY DEFAULT 'M'. "BOM Category
INITIALIZATION.
REFRESH ITAB_BOM.
CLEAR WA_BOM.
REFRESH IT_STB.
REFRESH IT_MATCAT.
START-OF-SELECTION.
SELECT matnr
werks
stlal
INTO CORRESPONDING FIELDS OF TABLE itab_bom
FROM mast
WHERE matnr IN s_matnr
AND werks IN s_plant
AND stlan = p_usage
AND stlal = p_alter.
CLEAR V_MATNR.
CLEAR V_WERKS.
DATA: WA_STB TYPE STPOX,
WA_MATCAT TYPE CSCMAT.
v_matnr = wa_bom-matnr.
v_werks = wa_bom-werks.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = p_appli
datuv = sy-datum
mktls = 'X'
mehrs = 'X'
mtnrv = v_matnr
stlal = p_alter
stlan = p_usage
werks = v_werks
TABLES
stb = it_stb
matcat = it_matcat
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Then just print whatever data u want it_stb, it_matcat tables.
reward points if u find my answer helpfull. -
How fact links to Dimension Tables.
Hi All,
Can any one explain how the ROW_WID of the dimension table and the related column in the fact table both gets populated with same values in different mapping ?
Consider if we want to develop a new fact and dimension tables, then how should i proceed for the ROW_WID and the join between fact and dimension.
Thanks in Advance.
Regards
VishwanathHi
Basically in BI Apps all dims are first populated and every dim table has a row wid column apart from the primary key combination(datasourceid+integration id) .If you open a seeded mapping and you would see this row wid column is populated using a reusable sequence generator transformation.So everytime u run this mapping the row wids change..........
Now coming to the facts............as a normal rule of thumb in ETL u run the facts after all the dimensions........If you open any seeded fact mapping you will observe that every fact has a wid associated the dims it joins to.......so if a fact is joining to 3 dims then there will be 3 wids associated to each dim .These wids are again populated using a lookup on the dimension table and extracting row wid for relavant id of the dim.So u get the value of row wid of the dimension in the wid column of the fact....Please let me know if u hv questions
With Regards
Venkatesh -
How two link two extern tables in one in BW ?
Hello everybody,
I have 2 extern tables with few data (6000):
ZETL_NEGO:
Number/AIRPORT/DATEFROM/DATETO/AMOUNT_NF
10;CDG;10/02/08;20/05/08;100
ZETL_PRICE:
AIRPORT/FARE_PUBLIC
CDG;400
I wanted to load these 2 tables in BW.
And i want obtain the following result:
10;CDG;10/02/08;20/05/08;100;400
and not these 2 lines:
10;CDG;10/02/08;20/05/08;100;0
; ; ; ; ;400
I want join these two tables ...
- I create an ODS specific to load ZETL_NEGO with
KeyField=Number/AIRPORT/DATEFROM/DATETO
- I create an other ODS specific to load ZETL_PRICE with
KeyField=AIRPORT
- Then, i create a third ODS which load the two precedent with
KeyField=Number/AIRPORT/DATEFROM/DATETO
but, yes, it doesn't work.
These 2 tables are not join ...
Could you give me suggestions how do this?
Thanks in advance.
Best Regards,
Rod.Yes that way is not going to work, but when you are loading data from the first DSO, do a lookup to the second DSO with AIRPORT number. The only drawback with this is if you load the first DSO before the Second DSO, you will be losing some data and also you might have some issue if you are doing delta load. This will work fine with full loads.
Another option is leave the dso or create cube for each dso and create a multiprovider, and create a report off the multiprovider and when you create a report, you can use the option of 'Constant Selection' to make the report come in one line.
And final option is to create infoset of the two DSO'es which will create one records.
thanks.
Wond -
How do I expose XMLType data in the repository
Assume the PO schema po.xsd
[oracle@chambers oracle]$ head po.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
version="1.0"
xdb:storeVarrayAsTable="true">
<xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
<xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
<xs:sequence>
<xs:element name="Reference" type="ReferenceType" minOccurs="1" xdb:SQLName="REFERENCE"/>
<xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
<xs:element name="Reject" type="RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
...I have a document that conforms to the schema purchaseorder.xml
[oracle@chambers oracle]$ more purchaseorder.xml
<PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nubridges.com/jchambers/po">
<Reference>SBELL-2002100912333601PDT</Reference>
<Actions>
<Action>
<User>SVOLLMAN</User>
</Action>
</Actions>
<Reject/>
<Requestor>Sarah J. Bell</Requestor>
<User>SBELL</User>
<CostCenter>S30</CostCenter>
<ShippingInstructions>
<name>Sarah J. Bell</name>
<address>400 Oracle Parkway
Redwood Shores
CA
94065
USA</address>
Step 1. Register the schema
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'http://www.nubridges.com/jchambers/po',
SCHEMADOC => bfilename('ORACLE_USER_HOME', 'po.xsd'),
CSID => nls_charset_id('AL32UTF8'));
Step 2. Verify the registration
SQL> desc purchaseorder
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://www.nubridges.com/jchambers/po" Element "PurchaseOrder") STORAGE Object-relational TYPE "PURCHASEORDER_T"
Step 3. Insert a valid PO into the database
insert into purchaseorder values(XMLType(bfilename('ORACLE_USER_HOME', 'purchaseorder.xml'), nls_charset_id('AL32UTF8')));
Step 4. Verify PO insert ok
SQL> select * from purchaseorder
2 ;
SYS_NC_ROWINFO$
<PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamesNow, I want to be able to expose the purchase order via HTTP/WebDav. In other words, I want to create a repository resource.
Step 5. Create a folder
DECLARE
b BOOLEAN;
BEGIN
b := DBMS_XDB.createFolder('/jchambers');
END;
Step 6. Create the resource.
How do I do this using DBMS_XDB.createResource?
I know I want to use one of these approaches, but how (I need some examples):
Creates a new resource with the given XMLType data as its contents:
DBMS_XDB.CREATERESOURCE(
path IN VARCHAR2,
data IN SYS.XMLTYPE)
RETURN BOOLEAN;Given a REF to an existing XMLType row, creates a resource whose contents point to that row. That row should not already exist inside another resource:
DBMS_XDB.CREATERESOURCE(
path IN VARCHAR2,
datarow IN REF SYS.XMLTYPE)
RETURN BOOLEAN;Please advise. ThanksStep 6. Create the resource.
How do I do this using DBMS_XDB.createResource?
Creates a new resource with the given XMLType data as its contents:
In this case you do not need to insert the row into the table. When you create the resource XML DB will automatically store the contents of the resource in the table for you...
Eg
declare
res boolean;
begin
res := dbms_xdb.createResource('/jchambers/purchaseorder.xml',
bfilename('ORACLE_USER_HOME', 'purchaseorder.xml'), nls_charset_id('AL32UTF8'));
end;
/Given a REF to an existing XMLType row, creates a resource whose contents
point to that row. That row should not already exist inside another resource:
declare
res boolean;
xmlref ref xmltype;
begin
select ref(x)
into xmlref
from PURCHASEORDER x
where existsNode(object_value,'/Some/Xpath/That/Identifies/Exactly/One/Row') = 1;
res := dbms_xdb.createResource('/jchambers/purchaseorder.xml',xmlref);
end;
/ -
Join two xmltype table using Xquery
I am wondering how to join two xmltype tables in xml db database. both tables are schema based object-relational tables.
these are the examples:
academicProgram table contain batch of academicprogram.xml entries
<academicProgram>
<listOfCourse>
<course><id>1</id></course>
<course><id>2</id></course>
</listOfCourse>
</academicProgram>
course table contain all the course entries, each of them is an xml file based on the the course schema. for example,
course1.xml
<course>
<id>1</id>
<title>xxxxxxx</title>
<description>xxxxxxxxxxxxxx</description>
</course>
I used the following xquery code to merge the detailed course information from course table to the academic program information
select *
from XMLTable(
for $program in ora:view("HTU", "ACADEMICPROGRAM")
return <academicProgram xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"
for $node in $program/academicProgram/node()
return if (name($node) eq "listOfCourse")
then (
<listOfCourse>{
for $i in $node/course
for $j in ora:view("HTU", "COURSE")/course
where $i/id eq $j/id
return $j
}</listOfCourse>
else $node
</academicProgram>
it did return what I want, but the problem is it take more than 5 minutes to finish. is there someway to make it run faster? I have been struggling for a week, please help.
thanks in advance.
HailiDoes this work...
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> set autotrace on explain
SQL> set lines 150 pages 0 long 10000
SQL> --
SQL> begin
2 :schemaURL := 'http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/custom.xsd';
3 :schemaPath := '/public/custom.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<xs:schema xmlns:apcustom="http://www.mdanderson.org/schema/APEP/custom" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="
http://www.mdanderson.org/schema/APEP/custom" elementFormDefault="qualified" attributeFormDefault="unqualified">
5 <xs:element name="CourseCatalogCustomDataType">
6 <xs:annotation>
7 <xs:documentation>Comment describing your root element</xs:documentation>
8 </xs:annotation>
9 </xs:element>
10 </xs:schema>');
11 begin
12 if (dbms_xdb.existsResource(:schemaPath)) then
13 dbms_xdb.deleteResource(:schemaPath);
14 end if;
15 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
16 end;
17 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> begin
2 :schemaURL := 'http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd';
3 :schemaPath := '/public/courseCatalog.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<?xml version="1.0" encoding="UTF-8"?>
5 <!-- edited with XMLSpy v2006 rel. 3 U (http://www.altova.com) by John Grossman (UT MD Anderson Cancer Center)
6 -->
7 <xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:xs="http://www.w3.
org/2001/XMLSchema" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" targetNamespace="http://www.mdanderson.org/schema/APEP/courseCa
talog" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
8 <xs:import namespace="http://www.mdanderson.org/schema/APEP/custom" schemaLocation="http://aahmb10-147:7575/public/www.mdanderson.or
g/schema/APEP/custom.xsd"/>
9 <!-- ######################################## -->
10 <!-- GLOBAL ELEMENTS -->
11 <!-- ######################################## -->
12 <xs:element name="course" type="CourseType" xdb:defaultTable="COURSE">
13 <xs:annotation>
14 <xs:documentation>Comment describing your root element</xs:documentation>
15 </xs:annotation>
16 </xs:element>
17 <xs:element name="listOfCourse" type="ListOfCourseType" xdb:defaultTable="COURSELIST"/>
18 <xs:element name="courseCatalog" type="CourseCatalogType" xdb:defaultTable="COURSECATALOG"/>
19 <!-- ######################################## -->
20 <!-- GLOBAL TYPES -->
21 <!-- ######################################## -->
22 <xs:complexType name="CompositeIDType" xdb:SQLType="COURSE_COMPOSITEID_T">
23 <xs:sequence>
24 <xs:element name="prefix" xdb:SQLName="PREFIX">
25 <xs:simpleType>
26 <xs:restriction base="xs:string">
27 <xs:length value="2"/>
28 </xs:restriction>
29 </xs:simpleType>
30 </xs:element>
31 <xs:element name="level" type="xs:positiveInteger" xdb:SQLName="COURSELEVEL"/>
32 <xs:element name="creditHours" type="xs:positiveInteger" xdb:SQLName="CREDITHOURS"/>
33 <xs:element name="identNumber" xdb:SQLName="IDENTNUMBER">
34 <xs:simpleType>
35 <xs:restriction base="xs:string">
36 <xs:length value="2"/>
37 </xs:restriction>
38 </xs:simpleType>
39 </xs:element>
40 </xs:sequence>
41 </xs:complexType>
42 <xs:complexType name="CourseType" xdb:SQLType="COURSE_T">
43 <xs:sequence>
44 <xs:element name="id" type="xs:integer" minOccurs="0" xdb:SQLName="ID"/>
45 <xs:element name="compositeID" type="CompositeIDType" minOccurs="0" xdb:SQLName="COMPOSITEID"/>
46 <xs:element name="title" type="xs:string" minOccurs="0" xdb:SQLName="TITLE"/>
47 <xs:element name="description" type="xs:string" minOccurs="0" xdb:SQLName="DESCRIPTION"/>
48 <xs:element name="corequisite" type="CompositeIDType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="COREQUISITE"
xdb:defaultTable=""/>
49 <xs:element name="prerequisite" type="CompositeIDType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="PREREQUISITE
" xdb:defaultTable=""/>
50 <xs:element name="availability" minOccurs="0" xdb:SQLName="AVAILABILITY">
51 <xs:complexType>
52 <xs:sequence>
53 <xs:element name="startDate" type="xs:date" minOccurs="0" xdb:SQLName="STARTDATE"/>
54 <xs:element name="endDate" type="xs:date" minOccurs="0" xdb:SQLName="ENDDATE"/>
55 </xs:sequence>
56 </xs:complexType>
57 </xs:element>
58 </xs:sequence>
59 </xs:complexType>
60 <xs:complexType name="ListOfCourseType" xdb:SQLType="COURSE_LIST_T">
61 <xs:sequence minOccurs="0" maxOccurs="unbounded">
62 <xs:element name="id" type="xs:positiveInteger" minOccurs="0" xdb:SQLName="ID"/>
63 <xs:element ref="course" minOccurs="0"/>
64 </xs:sequence>
65 </xs:complexType>
66 <xs:complexType name="CourseCatalogType" xdb:SQLType="COURSE_CATALOG_T">
67 <xs:sequence minOccurs="0">
68 <xs:element name="id" type="xs:positiveInteger" minOccurs="0" xdb:SQLName="ID"/>
69 <xs:element ref="listOfCourse" minOccurs="0"/>
70 </xs:sequence>
71 </xs:complexType>
72 </xs:schema>');
73 begin
74 if (dbms_xdb.existsResource(:schemaPath)) then
75 dbms_xdb.deleteResource(:schemaPath);
76 end if;
77 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
78 end;
79 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> begin
2 :schemaURL := 'http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/academicProgram.xsd';
3 :schemaPath := '/public/academicProgram.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<?xml version="1.0" encoding="WINDOWS-1252"?>
5 <!-- edited with XMLSpy v2006 rel. 3 U (http://www.altova.com) by John Grossman (UT MD Anderson Cancer Center) -->
6 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:ap="http://www.mdanderson.org/sche
ma/APEP/courseCatalog" targetNamespace="http://www.mdanderson.org/schema/APEP/courseCatalog" elementFormDefault="qualified" attributeFormDef
ault="unqualified" xdb:storeVarrayAsTable="true">
7 <xs:include schemaLocation="http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd" />
8 <!-- ######################################## -->
9 <!-- GLOBAL ELEMENTS -->
10 <!-- ######################################## -->
11 <xs:element name="academicProgram" type="ap:AcademicProgramType" xdb:defaultTable="ACADEMICPROGRAM">
12 <xs:annotation>
13 <xs:documentation>Comment describing your root element</xs:documentation>
14 </xs:annotation>
15 </xs:element>
16 <!-- ######################################## -->
17 <!-- GLOBAL Types -->
18 <!-- ######################################## -->
19 <xs:complexType name="ListOfAcademicCredentialType" xdb:SQLType="ACADEMICCREDENTIAL_LIST_T">
20 <xs:sequence minOccurs="0" maxOccurs="unbounded">
21 <xs:element name="credential" type="ap:AcademicCredentialType" minOccurs="0" xdb:SQLName="CREDENTIAL"/>
22 </xs:sequence>
23 </xs:complexType>
24 <xs:complexType name="AcademicCredentialType" xdb:SQLType="ACADEMICCREDENTIAL_T">
25 <xs:sequence minOccurs="0">
26 <xs:element name="id" type="xs:integer" minOccurs="0" xdb:SQLName="ID"/>
27 <xs:element name="field" type="xs:string" minOccurs="0" xdb:SQLName="FIELD">
28 <xs:annotation>
29 <xs:documentation>Academic or professional field for which the credential is granted. Example: Clini
ical Laboratory Science</xs:documentation>
30 </xs:annotation>
31 </xs:element>
32 <xs:element name="typeCode" minOccurs="0" xdb:SQLName="TYPECODE">
33 <xs:annotation>
34 <xs:documentation>The type of credential. Example: Bachelor of Science</xs:documentation>
35 </xs:annotation>
36 <xs:simpleType>
37 <xs:restriction base="xs:string">
38 <xs:enumeration value="Bachelor of Science Degree"/>
39 <xs:enumeration value="Certificate"/>
40 </xs:restriction>
41 </xs:simpleType>
42 </xs:element>
43 </xs:sequence>
44 </xs:complexType>
45 <xs:complexType name="RequirementType" xdb:SQLType="ACADEMICPROGRAM_REQ_T">
46 <xs:sequence minOccurs="0">
47 <xs:element name="typeCode" type="xs:string" minOccurs="0" xdb:SQLName="TYPECODE"/>
48 <xs:element name="description" type="xs:string" minOccurs="0" xdb:SQLName="DESCRIPTION"/>
49 <xs:element name="scope" type="xs:string" minOccurs="0" xdb:SQLName="SCOPE"/>
50 </xs:sequence>
51 </xs:complexType>
52 <xs:complexType name="ListOfRequirementType" xdb:SQLType="ACADEMICPROGRAM_REQ_L_T">
53 <xs:sequence minOccurs="0">
54 <xs:element name="requirement" type="ap:RequirementType" minOccurs="0" xdb:SQLName="REQUIREMENT"/>
55 </xs:sequence>
56 </xs:complexType>
57 <xs:complexType name="AcademicProgramType" xdb:SQLType="ACADEMICPROGRAM_T">
58 <xs:sequence>
59 <xs:element name="name" type="xs:string" minOccurs="0" xdb:SQLName="NAME"/>
60 <xs:element name="description" type="xs:string" minOccurs="0" xdb:SQLName="DESCRIPTION"/>
61 <xs:element name="listOfAcademicCredential" type="ap:ListOfAcademicCredentialType" minOccurs="0"/>
62 <xs:element name="listOfRelatedParty" minOccurs="0" xdb:SQLName="LISTOFRELATEDPARTY"/>
63 <xs:element name="mission" type="xs:string" minOccurs="0" xdb:SQLName="MISSION"/>
64 <xs:element name="goals" type="xs:string" minOccurs="0" xdb:SQLName="GOAL"/>
65 <xs:element name="objectives" type="xs:string" minOccurs="0" xdb:SQLName="OBJECTIVES"/>
66 <xs:element name="competencies" minOccurs="0" xdb:SQLName="COMPETENCIES"/>
67 <xs:element name="selectionProcess" minOccurs="0" xdb:SQLName="SELECTIONPROCESS"/>
68 <xs:element name="listOfRequirement" type="ap:ListOfRequirementType" minOccurs="0"/>
69 <xs:element name="evaluationCriteria" minOccurs="0" xdb:SQLName="EVALUATIONCRITERIA"/>
70 <xs:element name="postBaccDegreeInfo" minOccurs="0" xdb:SQLName="POSTBACCDEGREEINFO"/>
71 <xs:element name="postBaccCertificateInfo" minOccurs="0" xdb:SQLName="POSTBACCCERTIFICATEINFO"/>
72 <xs:element name="advancedPlacement" minOccurs="0" xdb:SQLName="ADVANCEDPLACEMENT"/>
73 <xs:element name="graduation" minOccurs="0" xdb:SQLName="GRADUATION"/>
74 <xs:element name="curriculum" minOccurs="0" xdb:SQLName="CURRICULUM"/>
75 <xs:element name="listOfCourse" type="ap:ListOfCourseType" minOccurs="0" xdb:SQLName="LISTOFCOURSE"/>
76 </xs:sequence>
77 </xs:complexType>
78 </xs:schema>
79 ');
80 begin
81 if (dbms_xdb.existsResource(:schemaPath)) then
82 dbms_xdb.deleteResource(:schemaPath);
83 end if;
84 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
85 end;
86 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> insert into COURSE values ( xmltype(
2 '<?xml version="1.0" encoding="WINDOWS-1252"?>
3 <?altova_sps http://aahmb10-147:7575/public/www.mdanderson.org/template/APEP/courseInput.sps?>
4 <course xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" xmlns:xdb=
"http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mdanderson.org/schema/APE
P/courseCatalog http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd">
5 <id>53</id>
6 <compositeID>
7 <prefix>CL</prefix>
8 <level>4</level>
9 <creditHours>1</creditHours>
10 <identNumber>05</identNumber>
11 </compositeID>
12 <title>Urinalysis </title>
13 <description>A review of the anatomy and physiology of the kidney and the formation, elimination, and composition of urine and body flu
ids. Interpretation of urinary elements, chemical assays, and the correlation with normal and abnormal physiology.</description>
14 </course>'))
15 /
1 row created.
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
SQL> insert into COURSE values ( xmltype(
2 '<?xml version="1.0" encoding="WINDOWS-1252"?>
3 <?altova_sps http://aahmb10-147:7575/public/www.mdanderson.org/template/APEP/courseInput.sps?>
4 <course xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" xmlns:xdb=
"http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mdanderson.org/schema/APE
P/courseCatalog http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd">
5 <id>54</id>
6 <compositeID>
7 <prefix>CL</prefix>
8 <level>4</level>
9 <creditHours>1</creditHours>
10 <identNumber>05</identNumber>
11 </compositeID>
12 <title>Course 54</title>
13 <description>A review of the anatomy and physiology of the kidney and the formation, elimination, and composition of urine and body flu
ids. Interpretation of urinary elements, chemical assays, and the correlation with normal and abnormal physiology.</description>
14 </course>'))
15 /
1 row created.
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
SQL> insert into COURSE values ( xmltype(
2 '<?xml version="1.0" encoding="WINDOWS-1252"?>
3 <?altova_sps http://aahmb10-147:7575/public/www.mdanderson.org/template/APEP/courseInput.sps?>
4 <course xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" xmlns:xdb=
"http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mdanderson.org/schema/APE
P/courseCatalog http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd">
5 <id>55</id>
6 <compositeID>
7 <prefix>CL</prefix>
8 <level>4</level>
9 <creditHours>1</creditHours>
10 <identNumber>05</identNumber>
11 </compositeID>
12 <title>Course 55</title>
13 <description>A review of the anatomy and physiology of the kidney and the formation, elimination, and composition of urine and body flu
ids. Interpretation of urinary elements, chemical assays, and the correlation with normal and abnormal physiology.</description>
14 </course>'))
15 /
1 row created.
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
SQL> insert into ACADEMICPROGRAM values ( xmltype (
2 '<?xml version="1.0" encoding="WINDOWS-1252"?>
3 <!--Sample XML file generated by XMLSpy v2006 rel. 3 U (http://www.altova.com)-->
4 <academicProgram xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" x
mlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mdanderson.org/s
chema/APEP/courseCatalog http://aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/academicProgram.xsd">
5 <name>Clinical Laboratory Science</name>
6 <description>The clinical laboratory scientist is an essential member of the health care team, performing a myriad of laboratory proc
edures aimed at the diagnosis and treatment of disease.</description>
7 <listOfAcademicCredential>
8 <credential>
9 <id>0</id>
10 <field>String</field>
11 <typeCode>Bachelor of Science Degree</typeCode>
12 </credential>
13 <credential>
14 <id>0</id>
15 <field>String</field>
16 <typeCode>Bachelor of Science Degree</typeCode>
17 </credential>
18 <credential>
19 <id>0</id>
20 <field>String</field>
21 <typeCode>Bachelor of Science Degree</typeCode>
22 </credential>
23 </listOfAcademicCredential>
24 <listOfRelatedParty xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
25 <mission>String</mission>
26 <goals>String</goals>
27 <objectives>String</objectives>
28 <competencies xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
29 <selectionProcess xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
30 <listOfRequirement>
31 <requirement>
32 <typeCode>String</typeCode>
33 <description>String</description>
34 <scope>String</scope>
35 </requirement>
36 </listOfRequirement>
37 <evaluationCriteria xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
38 <postBaccDegreeInfo xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
39 <postBaccCertificateInfo xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
40 <advancedPlacement xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
41 <graduation xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
42 <curriculum xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
43 <listOfCourse>
44 <id>53</id>
45 <course>
46 <id>53</id>
47 <compositeID>
48 <prefix>CL</prefix>
49 <level>4</level>
50 <creditHours>1</creditHours>
51 <identNumber>05</identNumber>
52 </compositeID>
53 <title>Biochemistry</title>
54 <description>this is a test for the course biochemistry</description>
55 </course>
56 <course>
57 <id>55</id>
58 <compositeID>
59 <prefix>CL</prefix>
60 <level>4</level>
61 <creditHours>1</creditHours>
62 <identNumber>05</identNumber>
63 </compositeID>
64 <title>Something Else</title>
65 <description>this is a test for the course biochemistry</description>
66 </course>
67 </listOfCourse>
68 </academicProgram>'))
69 /
1 row created.
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
SQL> select extractValue(value(c),'/course/id')
2 from ACADEMICPROGRAM ap,
3 table (xmlsequence(extract(value(ap),'/academicProgram/listOfCourse/course','xmlns="http://www.mdanderson.org/schema/APEP/courseCatalo
g"'))) c
4 /
53
55
Execution Plan
Plan hash value: 3351541143
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 126 | 804 (0)| 00:00:10 |
| 1 | NESTED LOOPS | | 2 | 126 | 804 (0)| 00:00:10 |
|* 2 | INDEX FAST FULL SCAN | SYS_IOT_TOP_177341 | 2 | 66 | 802 (0)| 00:00:10 |
|* 3 | TABLE ACCESS BY INDEX ROWID| ACADEMICPROGRAM | 1 | 30 | 1 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | SYS_C0022632 | 1 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("SYS_NC_TYPEID$" IS NOT NULL)
3 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins
tance" 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-properti
es/><read-contents/></privilege>'))=1)
4 - access("NESTED_TABLE_ID"="ACADEMICPROGRAM"."SYS_NC0004200043$")
Note
- dynamic sampling used for this statement
SQL> select updateXML
2 (
3 ap.object_value,
4 '/academicProgram/listOfCourse',
5 ( select xmlelement
6 (
7 "listOfCourse",
8 xmlattributes('http://www.mdanderson.org/schema/APEP/courseCatalog' as "xmlns"),
9 ( select xmlagg ( xmlconcat(extract(object_value,'/course/id'), extract(object_value,'/course')) )
10 from course c,
11 table (xmlsequence(extract(ap.object_value,'/academicProgram/listOfCourse/course','xmlns="http://www.mdanders
on.org/schema/APEP/courseCatalog"'))) api
12 where extractValue(c.object_value,'/course/id') = extractValue(value(api),'/course/id')
13 )
14 ) from dual
15 ),
16 'xmlns:="http://www.mdanderson.org/schema/APEP/courseCatalog"'
17 )
18 from ACADEMICPROGRAM ap
19 /
<?xml version="1.0" encoding="WINDOWS-1252"?>
<!--Sample XML file generated by XMLSpy v2006 rel. 3 U (http://www.altova.com)--><academicProgram xmlns="http://www.mdanderson.org/schema/AP
EP/courseC
atalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/X
MLSchema-i
nstance" xsi:schemaLocation="http://www.mdanderson.org/schema/APEP/courseCatalog http://aahmb10-147:7575/public/www.mdanderson.org/schema/AP
EP/academi
cProgram.xsd">
<name>Clinical Laboratory Science</name>
<description>The clinical laboratory scientist is an essential member of the health care team, performing a myriad of laboratory procedure
s aimed at
the diagnosis and treatment of disease.</description>
<listOfAcademicCredential>
<credential>
<id>0</id>
<field>String</field>
<typeCode>Bachelor of Science Degree</typeCode>
</credential>
<credential>
<id>0</id>
<field>String</field>
<typeCode>Bachelor of Science Degree</typeCode>
</credential>
<credential>
<id>0</id>
<field>String</field>
<typeCode>Bachelor of Science Degree</typeCode>
</credential>
</listOfAcademicCredential>
<listOfRelatedParty xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<mission>String</mission>
<goals>String</goals>
<objectives>String</objectives>
<competencies xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<selectionProcess xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<listOfRequirement>
<requirement>
<typeCode>String</typeCode>
<description>String</description>
<scope>String</scope>
</requirement>
</listOfRequirement>
<evaluationCriteria xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<postBaccDegreeInfo xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<postBaccCertificateInfo xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<advancedPlacement xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<graduation xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<curriculum xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog"/>
<listOfCourse xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog">
<id xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog">53</id>
<course xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" xmlns:xdb="
http://xml
ns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mdanderson.org/schema/APEP/courseCat
alog http:
//aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd">
<id>53</id>
<compositeID>
<prefix>CL</prefix>
<level>4</level>
<creditHours>1</creditHours>
<identNumber>05</identNumber>
</compositeID>
<title>Urinalysis </title>
<description>A review of the anatomy and physiology of the kidney and the formation, elimination, and composition of urine and body fl
uids. Inte
rpretation of urinary elements, chemical assays, and the correlation with normal and abnormal physiology.</description>
</course>
<id xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog">55</id>
<course xmlns="http://www.mdanderson.org/schema/APEP/courseCatalog" xmlns:ns1="http://www.mdanderson.org/schema/APEP/custom" xmlns:xdb="
http://xml
ns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mdanderson.org/schema/APEP/courseCat
alog http:
//aahmb10-147:7575/public/www.mdanderson.org/schema/APEP/courseCatalog.xsd">
<id>55</id>
<compositeID>
<prefix>CL</prefix>
<level>4</level>
<creditHours>1</creditHours>
<identNumber>05</identNumber>
</compositeID>
<title>Course 55</title>
<description>A review of the anatomy and physiology of the kidney and the formation, elimination, and composition of urine and body fl
uids. Inte
rpretation of urinary elements, chemical assays, and the correlation with normal and abnormal physiology.</description>
</course>
</listOfCourse>
</academicProgram>
Execution Plan
Plan hash value: 1698158615
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 47932 | 3 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 13818 | | |
|* 2 | HASH JOIN | | 1 | 13818 | 5 (20)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | SYS_IOT_TOP_177341 | 1 | 33 | 2 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL| COURSE | 3 | 41355 | 3 (0)| 00:00:01 |
| 5 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
|* 6 | TABLE ACCESS FULL | ACADEMICPROGRAM | 1 | 47932 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("COURSE"."SYS_NC00009$"="ID")
3 - access("NESTED_TABLE_ID"=:B1)
filter("SYS_NC_TYPEID$" IS NOT NULL)
4 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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
-properties/><read-contents/></privilege>'))=1)
6 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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
-properties/><read-contents/></privilege>'))=1)
Note
- dynamic sampling used for this statement
SQL>
Maybe you are looking for
-
ITunes is not picking up my iPhone or iPad when I connect (it does see my Nano)
Not sure what happened but in the last week, iTunes won't pick-up my iPhone or iPad under "devices" when I connect to my Mac. I have not been able to sync either device or update their software. iTunes is picking up my Nano and iPod Shuffle.
-
Ipod playlists greyed out in itunes
I am having a problem when my ipod is connected to my computer. It connects to itunes, but when I click on the ipod or playlists in the ipod everything is greyed out and I can not click on it. I am not able to drag new downloaded songs into any of my
-
I've been using iphone since ip2. it was really bad phone till 3s came up. now I'm using 5s and it still lacks of some good features. I'm sick of iphone now but I won't change it to 1020, waiting for next model. 1- voice record while talking. 2- real
-
VBU-FKSAA field not updated when the item category is changed
Hi, The sales order is created with the item category ZZZZ which is not relevant for billing. So the VBUP-FKSAA value is blank which means not relevant for billing. Now in the change mode, the item catg is changed to XXXX. this is relevant for billin
-
Can I Transfer Dot Mac Pages to iWeb?
Do any of you know if it is possible to take web pages I created using the online templates with Dot Mac (http://homepage.mac.com/bingalls) and move them into iWeb for editing? My plan will be to move all of my pages to my own domain but people are u