Read XML with different schema definitions
Hello
I have a XML stored in an XMLTYPE table and I have no problem to read the first part (ELMAHeader)
WITH t AS( SELECT XMLTYPE( q'[<?xml version = '1.0' encoding = 'UTF-8'?> <ELMAKM xsi:noNamespaceSchemaLocation="./KM/01.00/ELMAKM_000001.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:km="http://www.zivit.de/KiStA/KiStAM/V1.0/KiStA-KiStAM-Anfrage"> <ELMAKOM> <ELMAHeader ELMAKMVersion="1"> <AuthSteuernummer>BG</AuthSteuernummer> <AccountID>11</AccountID> <KundeneigeneID>1</KundeneigeneID> <Verarbeitungslauf>PROD</Verarbeitungslauf> <ErstellungsDatum>2014-09-16</ErstellungsDatum> <ErstellungsZeit>11:00:27.7</ErstellungsZeit> </ELMAHeader> <ELMAVerfahren> <KISTA_KM_ANTW UUID="0345" OrdBegriff="SLD" xsi:schemaLocation="http://www.zivit.de/KiStA/KM/01.00-r000001 ./KM/01.00/ELMAKM_KISTA_000001.xsd" xmlns="http://www.zivit.de/KiStA/KM/01.00-r000001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:k="http://www.zivit.de/KiStA/Std/01.00-r000001"> <KiStAV_DL Zulassungsnummer="2"/> <KiStAV Zulassungsnummer="2" Name="SLD"/> <Antwort xsi:type="AntwortArt3" UUID="0f" KdOrdBegriff="4"> <ReturnCode>1</ReturnCode> <Anlass Datum="2014-08-11" Grund="1"/> <PersAngabe> <Person> <k:NName>B</k:NName> <k:VName>Y</k:VName> <k:GebDt>1944-10-11</k:GebDt> </Person> <Adresse xsi:type="k:InlandsAdresse"> <k:Str>A-Str.</k:Str> <k:HausNr>5</k:HausNr> <k:Ort>M</k:Ort> <k:Plz>8</k:Plz> </Adresse> </PersAngabe> </Antwort> </KISTA_KM_ANTW> </ELMAVerfahren> </ELMAKOM> </ELMAKM>]') x FROM dual ) SELECT x ,elma.ELMAKMVersion ,elma.AuthSteuernummer ,elma.AccountID ,elma.KundeneigeneID FROM t ,XMLTABLE( '/ELMAKM/ELMAKOM/ELMAHeader' PASSING t.x COLUMNS ELMAKMVersion VARCHAR2(8) PATH '@ELMAKMVersion' ,AuthSteuernummer VARCHAR2(10) PATH 'AuthSteuernummer' ,AccountID VARCHAR2(10) PATH 'AccountID' ,KundeneigeneID VARCHAR2(10) PATH 'KundeneigeneID' ) elma ;
But how can I read the second part (ELMAVerfahren)? I tried several selects, but I get no results, for example
WITH ... SELECT x ,elma.UUID FROM t ,XMLTABLE( XMLNAMESPACES( DEFAULT './KM/01.00/ELMAKM_KISTA_000001.xsd' ,'http://www.zivit.de/KiStA/KiStAM/V1.0/KiStA-KiStAM-Anfrage' AS "km" ,'http://www.zivit.de/KiStA/Std/01.00-r000001' AS "k" ), '/ELMAKM/ELMAKOM/ELMAVerfahren/KISTA_KM_ANTW' PASSING t.x COLUMNS UUID VARCHAR2(8) PATH '@UUID' ) elma
Version of DB
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
Concerning
Marcus
Hi Marcus,
If you declare a namespace by default using the with XMLNamespaces clause, it will apply to all items not qualified, referenced by the XQuery expression.
In your attempt, ELMAKM, ELMAKOM and ELMAVerfahren are treated as part of the namespace by default, which is false as nodes are in any workspace names.
To manage this kind of situation, where there is default redefinitions of namespace in the tree, you must declare a prefix:
SELECT x
elma. UUID
T
XMLTABLE)
XMLNamespaces ('http://www.zivit.de/KiStA/KM/01.00-r000001' as "ns0")
, ' / ELMAKM/ELMAKOM/ELMAVerfahren / ns0:KISTA_KM_ANTW.
PASSAGE t.x
UUID VARCHAR2 COLUMNS (8) PATH '@UUID '.
) elma
;
Tags: Oracle Development
Similar Questions
-
create the different logfile with different schema by coil
Hello
I want to know how to create a different log file depend on different schema
I have two patterns on the same db Server
(1) drawing kennam / * / kennam
(2) diagram koonhey / * / koonhey
in a way, I want to create a log file name different for example kennam.log / koonhey.log on these two patterns...
I always run @showbalance; to run showbalance.sql to create this report...
I hope you understand what I'm talking about (English is not my mother tongue...), anyone could help?
showbalancelog. SQL
coil c:\log.log+.spool c:\log.log select to_char(sysdate,'dd-mm-yyyy hh:mi:ss') from dual; column com_name format a20; select cus.tid, cus.com_name com_name, cus.com_balance, NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice, NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income, cus.com_balance - NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) + NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance from customers cus order by cus.tid; spool off
Hello devotee,
You can select the user in a variable and then use that variable in your file name:
COLUMN act_user NEW_VALUE act_user NOPRINT; SET TERMOUT OFF SELECT USER act_user FROM dual; SET TERMOUT ON SPOOL t:\log_&act_user..log SELECT 'My data' FROM dual; SPOOL OFF
Concerning
Marcus -
Create view with different schemas
Hello
I would like to create a view using data on different patterns.
For example, user A has a table1 and user B has also a table1.
On the schema user C, I would make a union of two table in the same point of view as:
If user C is running:
Select * from A.table1
Union
Select * from B.table1
It's ok, but when I try:
CREATE or REPLACE view view_table1 AS FORCE
Select * from A.table1
Union
Select * from B.table1
It returns the ERROR at line 0: ORA-01031: insufficient privileges
But the C user has SELECT ANY TABLE, update ANY TABLE, DELETE ANY TABLE,... rights
Someone has an idea?
Thank you!
Published by: bushi893 on August 30, 2010 19:53When you create a view containing the object of different owners, the other owners have to grant "with grant option" to the owner of the view. Thus, the view owner can grant to other users or patterns...
Example: The latter is the owner of a table called mine_a User_b is the owner of a table called yours_b
Let's say user_b want to create a view with a join of mine_a and yours_b
To see it working properly, it must give "grant select on mine_a to user_b with grant option.
Then user_b may grant select on this point of view to everyone.
-
How to read the data with different XML schemas within the unique connection?
- I have Oracle database 11g
- I access it via JDBC: Slim, version 11.2.0.3, same as xdb.
- I have several tables, each has an XMLType column, all based on patterns.
- There are three XML schemas different registered in the DB
- Maybe I need to read the XML data in multiple tables.
- If all the XMLTypes have the same XML schema, there is no problem,
- If patterns are different, the second reading will throw BindXMLException.
- If I reset the connection between the readings of the XMLType column with different schemas, it works.
The question is: How can I configure the driver, or the connection to be able to read the data with different XML schemas without resetting the connection (which is expensive).
Code to get data from XMLType is the implementation of case study:
1 ResultSet resultSet = statement.executeQuery( sql ) ;
2 String result = null ;
3 while(resultSet.next()) {
4 SQLXML sqlxml = resultSet.getSQLXML(1) ;
5 result = sqlxml.getString() ;
6 sqlxml.free();
7 }
8 resultSet.close();
9 return result ;It turns out, that I needed to serialize the XML on the server and read it as BLOB. Like this:
1 final Statement statement = connection.createStatement() ; 2 final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ; 3 ResultSet resultSet = statement.executeQuery( sql ) ; 4 String result = null ; 5 while(resultSet.next()) { 6 Blob blob = resultSet.getBlob( 1 ); 7 InputStream inputStream = blob.getBinaryStream(); 8 result = new Scanner( inputStream ).useDelimiter( "\\A" ).next(); 9 inputStream.close(); 10 blob.free(); 11 } 12 resultSet.close(); 13 statement.close(); 14 15 System.out.println( result ); 16 return result ; 17
Then it works. Still, can't get it work with XMLType in resultset. On the customer XML unwrapping explodes trying to pass to another XML schema. JDBC/XDB problem?
-
Please help to read the XML with XMLTable
Hi gurus,
I'm not very familiar with XML parsing. It seems to me that it should be very easy to get the data. For some reason, I'm having a problem to get the data.
SELECT *.
OF e util.hlsr_online_entries,.
XMLTABLE)
XmlNamespaces)
' http://tempuri.org/ ' as "dt",
("urn: schemas-microsoft-com: XML-diffgram-v1" as "dg")."/ DataTable / dg:diffgram/DocumentElement/JrShowCustomerHeifers.
PASSAGE XMLTYPE (e.entry_data)
COLUMNS
SeqNo TO the ORDINALITE,
DocumentID NUMBER PATH "DocumentID",.
PATH of VARCHAR2 (100) ClubName "ClubName") as test
WHERE e.ref_id = 33422The query above does all the data for me. My hunts is the problem with the tab DocumentElement. I tried a different variant management.
Please help me to resolve the application
I have the XML document following the DotNet developer
<? XML version = "1.0" encoding = "utf-8"? >
" < DataTable xmlns =" http://tempuri.org/ ">
< xs: Schema id = "NewDataSet" xmlns = "" "xmlns: XS =" " http://www.w3.org/2001/XMLSchema " "xmlns:msdata ="urn: schemas-microsoft-com: xml-msdata" >
< xs: element name = "NewDataSet" msdata:IsDataSet = "true" msdata:MainDataTable = "JrShowCustomerHeifers" msdata:UseCurrentLocale = "true" >
< xs: complexType >
< xs: Choice minOccurs = "0" maxOccurs = "unbounded" >
< xs: element name = "JrShowCustomerHeifers" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "DocumentID" type = "xs: int" minOccurs = "0" / >
< xs: element name = "ClubName" type = "xs: String" minOccurs = "0" / >
< xs: element name = "Name" type = "xs: String" minOccurs = "0" / >
< xs: element name = "FirstName" type = "xs: String" minOccurs = "0" / >
< xs: element name = "PreferredName" type = "xs: String" minOccurs = "0" / >
< xs: element name = "Email" type = "xs: String" minOccurs = "0" / >
< xs: element name = "Exhibitor" type = "xs: String" minOccurs = "0" / >
< xs: element name = "AnimalName" type = "xs: String" minOccurs = "0" / >
< xs: element name = "RegistryNo" type = "xs: String" minOccurs = "0" / >
< xs: element name = "DateofBirth" type = "xs: String" minOccurs = "0" / >
< xs: element name = "NameofSire" type = "xs: String" minOccurs = "0" / >
< xs: element name = "SireRegistryNo" type = "xs: String" minOccurs = "0" / >
< xs: element name = "NameofDam" type = "xs: String" minOccurs = "0" / >
< xs: element name = "DamRegistryNo" type = "xs: String" minOccurs = "0" / >
< xs: element name = "Tattoo" type = "xs: String" minOccurs = "0" / >
< xs: element name = "SecondaryTattoo" type = "xs: String" minOccurs = "0" / >
< xs: element name = "UniversalIDNumber" type = "xs: String" minOccurs = "0" / >
< xs: element name = "Tattoo_Location" type = "xs: String" minOccurs = "0" / >
< xs: element name = "Secondary_Tattoo_Location" type = "xs: String" minOccurs = "0" / >
< xs: element name = "OracleBreedID" type = "xs: int" minOccurs = "0" / >
< xs: element name = "JrValidationBreedName" type = "xs: String" minOccurs = "0" / >
< xs: element name = "ValidationDate" type = "xs: DateTime" minOccurs = "0" / >
< xs: element name = "ValidatedBy" type = "xs: String" minOccurs = "0" / >
< xs: element name = "ValidationComment" type = "xs: String" minOccurs = "0" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< / xs: Choice >
< / xs: complexType >
< / xs: element >
< / xs: Schema >
< xmlns:msdata = diffgr:diffgram "" urn: schemas-microsoft-com: xml-msdata "xmlns:diffgr =" urn: schemas-microsoft-com: XML-diffgram-v1 ">"
< DocumentElement xmlns = "" >
< JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers1" msdata:rowOrder = "0" >
< > 18442 DocumentID < / DocumentID >
< ClubName > Perrin FFA < / ClubName >
Hamman < name > < / LastName >
< FirstName > Charles < / name >
< email > [email protected] < / email >
< setting > hammam, Charles < / Exhibitor >
< > 113 AnimalName < / AnimalName >
< RegistryNo > C1026447 < / RegistryNo >
< DateofBirth > 14/01/2013 < / DateofBirth >
< NameofSire > 808 808 DAYS of MATCH LH < / NameofSire >
< SireRegistryNo > C961101 < / SireRegistryNo >
SADIE 7/7 < NameofDam > < / NameofDam >
< DamRegistryNo > C941067 < / DamRegistryNo >
< > 113 tattoo < / tattoo >
< SecondaryTattoo / >
< UniversalIDNumber > 1194F020 < / UniversalIDNumber >
< Tattoo_Location > TATTOO - left ear < / Tattoo_Location >
< Secondary_Tattoo_Location / >
< OracleBreedID > 6383 < / OracleBreedID >
Beefmaster < JrValidationBreedName > < / JrValidationBreedName >
< ValidationDate > 2014-11-25T 08: 39:00 - 06:00 < / ValidationDate >
< ValidatedBy > laineyb < / ValidatedBy >
< ValidationComment / >
< / JrShowCustomerHeifers >
< JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers2" msdata:rowOrder = "1" >
< > 18473 DocumentID < / DocumentID >
< ClubName > Perrin FFA < / ClubName >
Hamman < name > < / LastName >
< FirstName > Charles < / name >
< email > [email protected] < / email >
< setting > hammam, Charles < / Exhibitor >
< AnimalName > PURPLE CORALEE 349 KPH < / AnimalName >
< RegistryNo > P43461953 < / RegistryNo >
< DateofBirth > 04/11/2013 < / DateofBirth >
< NameofSire > PURPLE MOXY 22 X AND < / NameofSire >
< SireRegistryNo > P43126458 < / SireRegistryNo >
< NameofDam > TCC CORKY 6603 < / NameofDam >
< DamRegistryNo > P42457119 < / DamRegistryNo >
< > 349 tattoo < / tattoo >
< SecondaryTattoo > km/h < / SecondaryTattoo >
< UniversalIDNumber > 1194F021 < / UniversalIDNumber >
< Tattoo_Location > TATTOO - left ear < / Tattoo_Location >
< Secondary_Tattoo_Location > TATTOO - right ear < / Secondary_Tattoo_Location >
< OracleBreedID > 6389 < / OracleBreedID >
< JrValidationBreedName > Polled Hereford < / JrValidationBreedName >
< ValidationDate > 2014 - 12-01 T 11: 55:00 - 06:00 < / ValidationDate >
Hannah < ValidatedBy > < / ValidatedBy >
< ValidationComment / >
< / JrShowCustomerHeifers >
< JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers3" msdata:rowOrder = "2" >
< > 18474 DocumentID < / DocumentID >
< ClubName > Perrin FFA < / ClubName >
Hamman < name > < / LastName >
< FirstName > Charles < / name >
< email > [email protected] < / email >
< setting > hammam, Charles < / Exhibitor >
< AnimalName > LANGFORDS SWEET N SOUR 4107 < / AnimalName >
< RegistryNo > 43504761 < / RegistryNo >
< DateofBirth > 02/03/2014 < / DateofBirth >
< NameofSire > LH TNT 1017 < / NameofSire >
< SireRegistryNo > 43199794 < / SireRegistryNo >
< NameofDam > LANGFORDS LADY 2206 AND < / NameofDam >
< DamRegistryNo > 43315143 < / DamRegistryNo >
< > 4107 tattoo < / tattoo >
< SecondaryTattoo / >
< UniversalIDNumber > 1194F018 < / UniversalIDNumber >
< Tattoo_Location > TATTOO - left ear < / Tattoo_Location >
< Secondary_Tattoo_Location / >
< OracleBreedID > 6398 < / OracleBreedID >
Hereford < JrValidationBreedName > < / JrValidationBreedName >
< ValidationDate > 2014-11-24T 14:26:00 - 06:00 < / ValidationDate >
Validator < ValidatedBy > < / ValidatedBy >
< ValidationComment / >
< / JrShowCustomerHeifers >
< JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers4" msdata:rowOrder = "3" >
< > 18475 DocumentID < / DocumentID >
< ClubName > Perrin FFA < / ClubName >
Hamman < name > < / LastName >
< FirstName > Charles < / name >
< email > [email protected] < / email >
< setting > hammam, Charles < / Exhibitor >
< AnimalName > PURPLE CCC 19A LYDIA < / AnimalName >
< RegistryNo > P43406978 < / RegistryNo >
< DateofBirth > 05/02/2013 < / DateofBirth >
< NameofSire > PURPLE MB WOMANIZER 14UET < / NameofSire >
< SireRegistryNo > P42945146 < / SireRegistryNo >
< NameofDam > PURPLE CMCC NASTIA 9U < / NameofDam >
< DamRegistryNo > P42927201 < / DamRegistryNo >
< > 19A tattoo < / tattoo >
< SecondaryTattoo / >
< UniversalIDNumber > 1194F017 < / UniversalIDNumber >
< Tattoo_Location > TATTOO - left ear < / Tattoo_Location >
< Secondary_Tattoo_Location / >
< OracleBreedID > 6389 < / OracleBreedID >
< JrValidationBreedName > Polled Hereford < / JrValidationBreedName >
< ValidationDate > 2014 - 12-01 T 11: 55:00 - 06:00 < / ValidationDate >
Hannah < ValidatedBy > < / ValidatedBy >
< ValidationComment / >
< / JrShowCustomerHeifers >
< JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers5" msdata:rowOrder = "4" >
< > 18477 DocumentID < / DocumentID >
< ClubName > Perrin FFA < / ClubName >
Hamman < name > < / LastName >
< FirstName > Charles < / name >
< email > [email protected] < / email >
< setting > hammam, Charles < / Exhibitor >
< AnimalName > PURPLE SGW EDEN 12 b < / AnimalName >
< RegistryNo > P43521932 < / RegistryNo >
< DateofBirth > 02/04/2014 < / DateofBirth >
< NameofSire > first TIME's a WASTINe 0124 < / NameofSire >
< SireRegistryNo > 43123163 < / SireRegistryNo >
< NameofDam > PURPLE SM WONDER WOMAN 160Y < / NameofDam >
< DamRegistryNo > P43235169 < / DamRegistryNo >
< tattoo > 12 b < / tattoo >
< SecondaryTattoo > 12 b < / SecondaryTattoo >
< UniversalIDNumber > 1194F015 < / UniversalIDNumber >
< Tattoo_Location > TATTOO - left ear < / Tattoo_Location >
< Secondary_Tattoo_Location > TATTOO - right ear < / Secondary_Tattoo_Location >
< OracleBreedID > 6389 < / OracleBreedID >
< JrValidationBreedName > Polled Hereford < / JrValidationBreedName >
< ValidationDate > 2014 - 12-01 T 11: 56:00 - 06:00 < / ValidationDate >
Hannah < ValidatedBy > < / ValidatedBy >
< ValidationComment / >
< / JrShowCustomerHeifers >
< / DocumentElement >
< / diffgr:diffgram >
< / DataTable >
user12021633 wrote:
Regarding your suggestion, I've never used the syntax of FLWOR. I'll try to implement if I can make it work.
"FLWOR is the abbreviation of ' for Let's where Order by Return" and refers to the full form of an XQuery query expression.
Do you think it would be faster than the way I have the values?
You have used a FLWOR expression (the 'for' + 'return' part of it) in this post: Re: Please help to read the XML with XMLTable
And I have already said: do not use in this case.
Faster or slower isn't the point. Oracle will evaluate the expression in the same way.
But from a maintenance point of view, it's obviously much easier to use a simple XPath expression like this:
/DT:GetJrShowCustomerHeifersResponse / dt:GetJrShowCustomerHeifersResult / dg:diffgram/DocumentElement/JrShowCustomerHeifers
-
How to work directly with the schemas imported or included xml db?
Hello Forum,
+ [my system: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0, windows 7, 8 GB of RAM, Enterprise edition of altova xmlspy 2007] +.
Help, please? I browsed this forum. I googled like crazy. I have read and reread the db xml docs. for 16 hours straight, I tried everything I can think of to fix this. but I can not yet understand what goes wrong.
After you have added annotations that are appropriate to the hierarchially-dependent five (imported and/or included) third patterns, I registered successfully the schemas in the xml db repository. all patterns and their associated with successful instance documents validate in Altova XMLSpy.
I was able to insert a xml instance doc successfully in an auto-generated XMLType table ("+ ct - valid.xml + ') which was based on one of the patterns (" + envelope-v2 - 0.xsd + '). However, when I tried to insert in its corresponding XMLType table, one other instance doc ("+ cis - valid_irenvelope_request_0.xml + '), based on another of patterns (' + AgentAuthRequest-v1 - 2.xsd + '), I got:
the "+ IRenvelope +" element (defined in "+ AgentAuthRequest-v1 - 2.xsd + ') refers to her child" + IRheader + "element of a schema included (" + base-v2 - 0.xsd + "); ' + IRheader / PeriodEnd + "is set to" + base-v2 - 0.xsd + ".ERROR at line 1: ORA-30937: No schema definition for 'PeriodEnd' (namespace 'http://www.govtalk.gov.uk/taxation/AgentAuthRequest/1') in parent '/IRenvelope/IRheader' ORA-06512: at "SYS.XMLTYPE", line 295 ORA-06512: at line 1
Please, help me understand what I need to do to make this work? the above patterns are in this zip file .
Thanks in advance for your help.
the following files are included in this zip file :
AgentAuthRequest-v1 - 2.xsd
Core-v2 - 0.xsd
Sun - certified_registerSchema_calls_0.txt
CIS - valid_irenvelope_request_0.xml
CT - valid.xml
trace udump filesI reproduced the problem on 10.2.0.4 (the closest I can get to your version) and 11.2.0.2 too.
I call it a bug that I may be missing something, but it seems that "Design Chameleon" is not supported.
Most of the time, xs: include is used to include another scheme which is in the same namespace as the includer target.
But it should also work when you include a diagram in no namespace (core-v2 - 0.xsd in this case), its definitions are then "imported" names within target.In this case, included base-v2-0 definitions are apparently not moved to namespace 'http://www.govtalk.gov.uk/taxation/AgentAuthRequest/1' and are in no namespace, where the error.
For example, the way space default namespace for elements included work:
1967-08-13 Individual ... Declaring the same target namespace in core-v2-0 works as well.
-
Please forgive me for not knowing how to use this forum, I am an old man and not good at computers, I called Adobe, they said it was my only hope!
Sorry to repeat
Everything was fine until my Windows 10, lost the start feature, so I had to go back to Windows 7, in this process, I lost my Adobe Reader software, I tried about ten times with different versions and different locations, all with the same error message that is download "the feature you are trying to use is on an unavailable network resource"... are looking for It seems that it does not find when I search there, and I no longer seem to have the AcroRead.msi... the most difficult file, I try, I get deeper and deeper into things I don't know... I am looking for a simple solution!
When it gets to this point, it is probably better to start from scratch.
First of all, download, install and run Adobe Reader cleaning tool to get rid of all remains little. Here is a link to the tool: Download Adobe Reader and Acrobat tool - Adobe Labs
Then go to the following link to download the full installer for the reader.
-
flow of Installer for tables with source schemas and destination is different
How to set up courses of water for tables with source schemas and destination is different? But the structure of the table is the same.
Please paste a small example too.
Thank you
BalaHello
I have a concrete example of this issue, I tested in my environment. Please follow the steps below to install this on your databases.
My global_name to database source is: REP102A. WORLD
My global_name to database target is: REP102B. WORLDSource table: ORDERS. ORDER_ENTRY
Target Table: MERCHANT NAVY. ORDER_ENTRYReplication will happen as follows:
ORDERS. ORDER_ENTRY (REP102A)-> SHIPPING. ORDER_ENTRY (REP102B)Needs to follow the steps below as the one proposed at each site. You may need to make the changes required for your environment.
SCRIPT:
=======* 1. Remove the configuration of the flow of SOURCE and TARGET sites: *.
CONNECT / as SYSDBA
RUN DBMS_STREAMS_ADM. REMOVE_STREAMS_CONFIGURATION;
DROP USER CASCADE STRMADMIN;* 2. Installation STRMADMIN user and streams queued on the Source database: *.
CONNECT / as sysdba
Strmadmin CREATE USER IDENTIFIED BY strmadmin;
GRANT dba, connect, resource, aq_administrator_role to strmadmin;
ALTER SYSTEM SET aq_tm_processes = 1;
BEGIN
DBMS_STREAMS_AUTH. () GRANT_ADMIN_PRIVILEGE
dealer-online "strmadmin."
grant_privileges => TRUE);
END;
/CONNECT strmadmin/strmadmin
BEGIN
DBMS_STREAMS_ADM. () SET_UP_QUEUE
queue_table-online "streams_queue_table."
queue_name-online "streams_capture_queue."
queue_user-online "strmadmin");
END;
/* 3. Installation STRMADMIN user and streams queued to the database target: *.
CONNECT / as sysdba
Strmadmin CREATE USER IDENTIFIED BY strmadmin;
GRANT dba, connect, resource, aq_administrator_role to strmadmin;
ALTER SYSTEM SET aq_tm_processes = 1;
BEGIN
DBMS_STREAMS_AUTH. () GRANT_ADMIN_PRIVILEGE
dealer-online "strmadmin."
grant_privileges => TRUE);
END;
/CONNECT strmadmin/strmadmin
BEGIN
DBMS_STREAMS_ADM. () SET_UP_QUEUE
queue_table-online "streams_queue_table."
queue_name-online "streams_apply_queue."
queue_user-online "strmadmin");
END;
/* 4. Create ORDERS. ORDER_ENTRY Table on the Source database: *.
CREATE USER controls IDENTIFIED BY;
GRANT connect, resource TO arrested;
CONNECT orders/ordersCREATE THE ORDERS TABLE. ORDER_ENTRY
(
order_id number (8) primary key,.
ORDER_ITEM varchar2 (30),
ship_no number (8)
);* 5. Create shipping. Target ORDER_ENTRY Table on the database: *.
CREATE USER IDENTIFIED BY expedition expedition;
GRANT connect, navigation resources;
CONNECT shipping/deliveryCREATE TABLE EXPEDITION TO FRANCE. ORDER_ENTRY
(
order_id number (8) primary key,.
ORDER_ITEM varchar2 (30),
ship_no number (8)
);* 6. On the target, add the rules to apply and create a dblink from destination to source: *.
CONNECT strmadmin/strmadmin
SET SERVEROUTPUT ON
DECLARE
v_dml_rule VARCHAR2 (80);
v_ddl_rule VARCHAR2 (80);
BEGIN
DBMS_STREAMS_ADM. () ADD_TABLE_RULES
table-name => ' EXPEDITION. ORDER_ENTRY',.
streams_type-online "apply."
streams_name-online "streams_apply."
queue_name-online "strmadmin.streams_apply_queue."
include_dml to-online true.
include_ddl-online fake,
include_tagged_lcr-online fake,
source_database => ' REP102A. WORLD ',.
dml_rule_name-online v_dml_rule,
ddl_rule_name-online v_ddl_rule,
inclusion_rule-online true);
DBMS_OUTPUT. Put_line (' apply rule DML for SHIPPING.) ORDER_ENTRY => ' | v_dml_rule);
END;
/CREATE DATABASE LINK rep102a.world CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'rep102a ';
-check the link works with:
SELECT * from [email protected];BEGIN
DBMS_APPLY_ADM. () ALTER_APPLY
apply_name-online "streams_apply."
apply_user-online "strmadmin");
END;
/* 7. The source adds the rules of capture, transformation, create a database link for target, add spread rules, then prepare the tables for instantiation: *.
CONNECT strmadmin/strmadmin
SET SERVEROUTPUT ON
DECLARE
v_dml_rule VARCHAR2 (80);
v_ddl_rule VARCHAR2 (80);
BEGIN
DBMS_STREAMS_ADM. () ADD_TABLE_RULES
table-name => ' ORDERS. ORDER_ENTRY',.
streams_type-online "capture."
streams_name-online "streams_capture."
queue_name-online "strmadmin.streams_capture_queue."
include_dml to-online true.
include_ddl-online fake,
include_tagged_lcr-online fake,
source_database => ' REP102A. WORLD ',.
dml_rule_name-online v_dml_rule,
ddl_rule_name-online v_ddl_rule,
inclusion_rule-online true);
DBMS_OUTPUT. Put_line ('Capture DML rule for ORDERS.) ORDER_ENTRY => ' | v_dml_rule);
-Add the schema to rename it to change ORDERS to NAVIGATION for this rule
DBMS_STREAMS_ADM. () RENAME_SCHEMA
nom_regle-online v_dml_rule,
from_schema_name-online "ORDERS."
to_schema_name-online 'EXPEDITION. "
operation => "ADD");
END;
/CREATE DATABASE LINK rep102b.world CONNECT TO strmadmin IDENTIFIED BY strmadmin USING 'rep102b ';
-check the link works with:
SELECT * from [email protected];-post-harvest enqueues the LCR will have schema as EXPEDITION via renamed of schema processing
-then add the rule of propagation for SHIPPING. ORDER_ENTRYSET SERVEROUTPUT ON
DECLARE
v_dml_rule VARCHAR2 (80);
v_ddl_rule VARCHAR2 (80);
BEGIN
DBMS_STREAMS_ADM. () ADD_TABLE_PROPAGATION_RULES
table-name => ' EXPEDITION. ORDER_ENTRY',.
streams_name-online "streams_prop."
source_queue_name-online "strmadmin.streams_capture_queue."
destination_queue_name-online "[email protected]."
include_dml to-online true.
include_ddl-online fake,
include_tagged_lcr-online fake,
source_database => ' REP102A. WORLD ',.
dml_rule_name-online v_dml_rule,
ddl_rule_name-online v_ddl_rule,
inclusion_rule to-online true.
queue_to_queue-online fake);
DBMS_OUTPUT. Put_line ("rule DML of Propagation for SHIPPING. ORDER_ENTRY => ' | v_dml_rule);
END;
/BEGIN
DBMS_CAPTURE_ADM. () PREPARE_TABLE_INSTANTIATION
table-name => ' ORDERS. ORDER_ENTRY',.
SUPPLEMENTAL_LOGGING-online 'key');
END;
/* 8. Set the instantiation scn for ORDERS. ORDER_ENTRY on the site target and start apply: *.
-Apply on site
CONNECT strmadmin/strmadmin
SET SERVEROUTPUT ON
DECLARE
iSCN NUMBER;
BEGIN
iSCN: = DBMS_FLASHBACK. [email protected] ();
DBMS_OUTPUT. Put_line (' instantiation SCN is: ' | iSCN);
DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
source_object_name => ' ORDERS. ORDER_ENTRY',.
source_database_name => ' REP102A. WORLD ',.
instantiation_scn-online iSCN,
apply_database_link => NULL);
COMMIT;
END;
/BEGIN
DBMS_APPLY_ADM. START_APPLY ('streams_apply');
END;
/-Check if apply is enabled
SELECT apply_name, dba_apply State;* 9. Start capturing on source: *.
CONNECT strmadmin/strmadmin
BEGIN
DBMS_CAPTURE_ADM. START_CAPTURE ('streams_capture');
END;
/* 10. Wait capture change its status of 'CAPTURER the CHANGES' and check that the status of propagation is ENABLED: *.
CONNECT strmadmin/strmadmin
SELECT capture_name, State FROM v$ streams_capture;
SELECT propagation_name, dba_propagation State;* 11. Perform inserts in ORDERS. Table ORDER_ENTRY on the source site: *.
CONNECT orders/orders
INSERT INTO orders.order_entry VALUES (23450, 'Johnny Walker', 98456);
INSERT INTO orders.order_entry VALUES (23451, "Chivas Regal", 98457);
COMMIT;* 12. On the site apply, check the DELIVERY. ORDER_ENTRY and check if the data is replicated: *.
CONNECT shipping/delivery
SELECT * FROM shipping.order_entry;* 13. Check the application errors in the queue to apply: *.
CONNECT strmadmin/strmadmin
SELECT apply_name, local_transaction_id, error_number, error_message FROM dba_apply_error;Thank you
Florent -
How to read the text of an XML with the dom parser?
Hi all
It's my code. How will I be able to read the text inside the xml file using dom parser?
my xml file is like this...
LLEYTON
Hewitt
Australian
1
897
André
Agassi
American
2
679
which I stored in _xml.
InputStream is = getClass () .getResourceAsStream (_xml);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance ();
DocumentBuilder db = dbf.newDocumentBuilder ();
Doc document = db.parse (is);
NodeList nl = doc.getElementsByTagName("*");
for (int i = 0; i)< nl.getlength();="">
{
System.out.println ("node name" + nl.item (i) .getNodeName ()); Player, firstname, lastname, tennis o/p
System.out.println ("node value" + nl.item (i) .getTextContent ()); o/p value null, null, null, null
}
I want the text in the first name should get displayed as "Lleyton" and any other text in other tags as Andre/Agassi/American/2/679
You can install JDE and operates the samples, you will find XMLDEMO that will help you read XML application blackberry;
good luck;
-
No schema definition for 'HTNG_ReadRQ' (namespace ") in parent ' / '.
I have successfully registered all the schema that are included in HTNG_ReadRQ. I tested the pattern recorded by validating against a xml code generated by a query PLSQL. I went to test the HTNG_ReadRQ and received the above error (no schema definition for 'HTNG_ReadRQ' (namespace ") in parent ' / '). I enclose you OTA_VehRetResRQ.xsd and HTNG_ReadRQ.xsd. I registered with GENTYPES = true and GENTABLES = false.
What a waste.
According to HTNG_ReadRQ, the target namespace is ' http://htng.org/2014B', not ' http://www.opentravel.org/OTA/2003/05'.»»» "
Second question is that you also have the attribute xsi: schemaLocation evil.
When the schema declares a target namespace, this attribute should read as follows:
"" xsi: schemaLocation = "
" where
is, in this case, "http://htng.org/2014B". and
is the url you use for registration of the scheme. -
Hi I have a problem of xml with xsd validation and insert into the table...
I use this function to validate the XML with xsd, but it gives-31000 error related to xdb
and I also try to recover data from the xml file, but it is fetching nullability of him.
while I was trying to recover data after removing the tablenamespace, url and other additional field or can tell
from a simple xml file than it is to get him.
Please help me with this!
FUNCTION to CREATE or REPLACE ALI$ XML_VALID (P_xml IN xmltype
P_xsd IN xmltype)
RETURN NUMBER
is
l_status NUMBER;
l_xml xmltype.
l_xsd XMLTYPE.
l_v_schemaURL VARCHAR2 (256): = "NewBusinessApplication.xsd";
schema_doesnt_exist exception;
pragma exception_init (schema_doesnt_exist,-31000);BEGIN
l_xsd: = p_xsd;
Start
DBMS_XMLSCHEMA.deleteSchema (l_v_schemaURL, dbms_xmlSchema.DELETE_CASCADE_FORCE);
exception
When schema_doesnt_exist then
null;
end;DBMS_XMLSCHEMA. REGISTERSCHEMA)
schemaurl = > l_v_schemaURL
, schemadoc = > l_xsd
local = > TRUE
, genTypes = > FALSE
, genbean = > FALSE
, genTables = > FALSE
);
l_xml: = p_xml;If l_xml.isSchemaValid () = 1 then
dbms_output.put_line ("' scheme is valid");
l_status: = 1;
RETURN l_status;
on the other
l_xml.schemaValidate ();
l_status: = 0;
RETURN l_status;
end if;
END;-call to above function
DECLARE
l_xml xmltype: = xmltype (' <? xml version = "1.0" encoding = "UTF - 8"? >)
"" < NewBusinessApplication xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
"" xsi: schemaLocation = "http://www.example.org NewBusinessApplication.xsd.
xmlns ="http://www.example.org" > ".
< TransactionHeader >
< TR_REF_NO > 000009812681 < / TR_REF_NO >
< EFF_DT > 20140703094140.572 [-4:US / Eastern] < / EFF_DT >
< SRC_SYS_CD dmnSRC_SYSTEM = "TSS" > Support of TV system < / SRC_SYS_CD >
< / TransactionHeader >
< ApplicationRq >
< ApplInfo >
< APPLNO > A00018L < / APPLNO >
< MED_NONMED dmnMED_NONMED = "M" > medical < / MED_NONMED >
< APPL_DT > 20140714 < / APPL_DT >
< EFF_DT > 20140714 < / EFF_DT >
< APPL_RECV_DT > 20140714 < / APPL_RECV_DT >
< / ApplInfo >
< AgentInfo >
<! – repeat the nodes below for more than one agent - >
<>Agent
< AGT_CD > AGN0000001 < / AGT_CD >
James < FIRSTNAME > < / NAME >
< NAME > Whorphin < / LASTNAME >
BKK1010090009 < AGT-LICNO > < / AGT-LICNO >
the Warriors < TEAM > < / TEAM >
Suriya Thapa < TEAMLEADER > < / TEAMLEADER >
BKK909988999 < TEAMLEADER-LICNO > < / TEAMLEADER LICNO >
< / agent >
< / AgentInfo >
< InsuredInfo >
< dmnPERS_NAMEPREFIX PREFIX-TH = "XX" > Dr. < / PREFIX-TH >
XXXXXXX < FIRSTNAME-TH > < / FIRSTNAME-TH >
XXXXXX < MIDNAME-TH > < / MIDNAME-TH >
XXXXXX < LASTNAME-TH > < / LASTNAME-TH >
XXXXXX < FORMERNAME > < / FORMERNAME >
< PREFIX-dmnPERS_NAMEPREFIX-EN = "XX" > Dr. < / PREFIX-EN >
YYYYYY < FIRSTNAME-EN > < / FIRSTNAME-EN >
YYYYYY < MIDNAME-EN > < / MIDNAME-FR >
YYYYYY < LASTNAME-EN > < / LASTNAME-EN >
< BIRTH_DT > 19800101 < / BIRTH_DT >
< 33 YEARS > < / AGE >
< dmnPERNSEXCD = "XX" SEX > male < / TYPE >
< DmnPERC_MAR_STAT_CD MARITAL_STATUS = "XX" > single < / MARITAL_STATUS >
< dmnRACE = "XX" RACE > ZZZ < / RACE >
< dmnRELIGION RELIGION = "H" > HINDU < / RELIGION >
< dmnNATIONALITY NATIONALITY = an' TH' > THAI < / NATIONALITY >
< dmnIDTYPE ID-TYPE = "TI" > Thai National ID < / ID-TYPE >
> ID < AJMPK0001J < / ID >
< ID-XPIR_DT > 20200101 < / ID-XPIR_DT >
< dmnOCCUP_CD OCCUPATION = "XX" / >
< OCCUP_CLASS dmnOCCUP_CLASS_CD = 'XX' / >
< ANNUAL_INCOME > 100000 < / ANNUAL_INCOME >
< HEIGHT > 175 < / HEIGHT >
< WEIGHT > 80 < / WEIGHT >
< / InsuredInfo >
< ProposerInfo >
< dmnPERS_NAMEPREFIX PREFIX-TH = "XX" > Dr. < / PREFIX-TH >
XXXXXXX < FIRSTNAME-TH > < / FIRSTNAME-TH >
XXXXXX < MIDNAME-TH > < / MIDNAME-TH >
XXXXXX < LASTNAME-TH > < / LASTNAME-TH >
XXXXXX < FORMERNAME > < / FORMERNAME >
< PREFIX-dmnPERS_NAMEPREFIX-EN = "XX" > Dr. < / PREFIX-EN >
YYYYYY < FIRSTNAME-EN > < / FIRSTNAME-EN >
YYYYYY < MIDNAME-EN > < / MIDNAME-FR >
YYYYYY < LASTNAME-EN > < / LASTNAME-EN >
< BIRTH_DT > 19800101 < / BIRTH_DT >
< 33 YEARS > < / AGE >
< dmnPERNSEXCD = "XX" SEX > male < / TYPE >
< DmnPERC_MAR_STAT_CD MARITAL_STATUS = "XX" > single < / MARITAL_STATUS >
< dmnRACE = "XX" RACE > ZZZ < / RACE >
< dmnRELIGION RELIGION = "H" > HINDU < / RELIGION >
< dmnNATIONALITY NATIONALITY = an' TH' > THAI < / NATIONALITY >
< dmnIDTYPE ID_TYPE = "TI" > Thai National ID < / ID_TYPE >
AJMPK0001J < ID_NUMBER > < / ID_NUMBER >
< ID_XPIR_DT > 20200101 < / ID_XPIR_DT >
< dmnOCCUP_CD OCCUPATION = "XX" / >
< OCCUP_CLASS dmnOCCUP_CLASS_CD = 'XX' / >
< ANNUAL_INCOME > 100000 < / ANNUAL_INCOME >
< / ProposerInfo >
< ContactInfo >
< AddressInfo >
<! – repeat the nodes below for each address type - >
< address >
< dmnADDR_ADDRTYPE ADDRTYPE = "01" > home < / ADDRTYPE >
< PRIMARY_CONTACT > 0 < / PRIMARY_CONTACT >
< / address >
< address >
< dmnADDR_ADDRTYPE ADDRTYPE "02" = > Office < / ADDRTYPE >
< PRIMARY_CONTACT > 1 < / PRIMARY_CONTACT >
< / address >
< / AddressInfo >
< PhoneInfo >
<! – repeat the nodes below for each type of phone - >
< Phone >
< dmnADRP_PHONETYPE PHONETYPE "01" = > Mobile < / PHONETYPE >
< PHONENUM > 9887666789 < / PHONENUM >
< PRIMARY_CONTACT > 1 < / PRIMARY_CONTACT >
< / Phone >
< Phone >
< dmnADRP_PHONETYPE PHONETYPE "02" = > home < / PHONETYPE >
< PHONENUM > 9887666789 < / PHONENUM >
< PRIMARY_CONTACT > 0 < / PRIMARY_CONTACT >
< / Phone >
< / PhoneInfo >
< EmailInfo >
<! – repeat the nodes below for each type of email - >
< email >
< EMAILTYPE dmnADRO_EMAILTYPE = "01" > e-mail1 < / EMAILTYPE >
< EMAILDATA > [email protected] < / EMAILDATA >
< PRIMARY_CONTACT > 0 < / PRIMARY_CONTACT >
< / email >
< email >
< EMAILTYPE dmnADRO_EMAILTYPE "02" = > Email2 < / EMAILTYPE >
< EMAILDATA > [email protected] < / EMAILDATA >
< PRIMARY_CONTACT > 1 < / PRIMARY_CONTACT >
< / email >
< / EmailInfo >
< / ContactInfo >
< PolicyInfo >
STG102 < BASE-PLAN_CD > < / BASE-PLAN_CD >
< BASE-PLAN_NM > Smart term 10 gold < / BASE-PLAN_NM >
< MODEOFPAYMENT dmnZZFREQUENCY = "M" > monthly < / MODEOFPAYMENT >
< BASE - ITS > 100000.00 < / BASE - SA >
< BASE-PREMIUM > 12000.00 < / BASE-PREMIUM >
< BASE-MODALPREMIUM > 1000.00 < / BASE-MODALPREMIUM >
< AYFP > 13200.00 < / AYFP >
< RiderInfo >
< rider >
RIDER < CODE > ME < / RIDER-CODE >
Medical costs < RIDER-NAME > < / RIDER-NAME >
< RIDER - HIS 20000.00 > < / RIDER - SA >
< RIDER-PREMIUM > 600.00 < / RIDER-PREMIUM >
< RIDER-MODALPREMIUM > 50.00 < / RIDER-MODALPREMIUM >
< / rider >
< rider >
RIDER HAB < CODE > < / RIDER-CODE >
< NAME-RIDER > Admission hospitalization < / RIDER-NAME >
< RIDER - HIS 20000.00 > < / RIDER - SA >
< RIDER-PREMIUM > 600.00 < / RIDER-PREMIUM >
< RIDER-MODALPREMIUM > 50.00 < / RIDER-MODALPREMIUM >
< / rider >
< / RiderInfo >
< / PolicyInfo >
< PaymentInfo >
< borde >
< TMP_RECEIPT_NO > TEMP0001 < / TMP_RECEIPT_NO >
< TOTAL_PYMT_AMT > 13200.00 < / TOTAL_PYMT_AMT >
<! – repeat the nodes below for payment through several channels - >
< payment >
< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >
credit card < dmnPaymentType PYMT TYPE = "01" > < / PYMT-TYPE >
< PYMT-AMT > 13200.00 < / PYMT-AMT >
< PYMT-Channel >
credit <>card
Visa < dmnCardType CARD-TYPE = "01" > < / CARD-TYPE >
< BADGE - N ° > 9890989098909877 < / CARD-NOT >
< HOLDERNAME-CARD > RICKY WHORPHIN < / CARD-HOLDERNAME >
< BANKNM-CARD > Standard Chartered Bank < / MAP-BANKNM >
< MAP SHOWED > 08/14 < / CARD-SHOW >
< MAP-AUTHCODE / >
< CARD-AUTHDATE / >
< / credit card >
< / PYMT-Channel >
< / payment >
< payment >
< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >
< dmnPaymentType PYMT-TYPE = '02' > account < / PYMT-TYPE >
< PYMT-AMT > 13200.00 < / PYMT-AMT >
< PYMT-Channel >
< Bank >
< BANK CODE / >
< BANK BRANCH / >
< BANK-ACCNO / >
< BANK-ACCNAME / >
< / Bank >
< / PYMT-Channel >
< / payment >
< payment >
< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >
< dmnPaymentType PYMT TYPE = "03" > check < / PYMT-TYPE >
< PYMT-AMT > 13200.00 < / PYMT-AMT >
< PYMT-Channel >
< check >
< CHQ - n / >
< CHQ-DATE / >
< CHQ-ISSUEBANK / >
< / cheque >
< / PYMT-Channel >
< / payment >
< / shell >
< RenewalPayment >
< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >
< DDCHANNEL dmnPaymentType "01" = > SDC < / DDCHANNEL >
< DDCDetails >
Visa < dmnCardType CARD-TYPE = "01" > < / CARD-TYPE >
< BADGE - N ° > 9890989098909877 < / CARD-NOT >
< HOLDERNAME-CARD > RICKY WHORPHIN < / CARD-HOLDERNAME >
< BANKNM-CARD > Standard Chartered Bank < / MAP-BANKNM >
< MAP SHOWED > 08/14 < / CARD-SHOW >
< / DDCDetails >
< DDADetails >
< dmnBNK_TYP_CD BANK-ACCTYPE = "01" > save < / BANK-ACCTYPE >
< BANK-ACCNO / >
< BANK-ACCNAME / >
< BANK BRANCH / >
< / DDADetails >
< / RenewalPayment >
< / PaymentInfo >
< BeneficiaryInfo >
<!--repeat the nodes below for each beneficiary and the sum of the pct should be 100-->
< recipient >
Joint < dmnBENE_RELT_CD RELATIONSHIP = "01" > < / RELATIONSHIP >
XXXX < FIRSTNAME > < / NAME >
XXXXX < MIDNAME > < / MIDNAME >
XXXX < NAME > < / LASTNAME >
< PERCENT > 50 < / PERCENTAGE >
< BIRTH_DT > 19800101 < / BIRTH_DT >
< dmnPERNSEXCD SEX = "XX" > female < / TYPE >
< NATLIDNO > TH000001 < / NATLIDNO >
< / recipients >
< recipient >
< dmnBENE_RELT_CD RELATIONSHIP "02" = > child < / RELATIONSHIP >
XXXX < FIRSTNAME > < / NAME >
XXXXX < MIDNAME > < / MIDNAME >
XXXX < NAME > < / LASTNAME >
< PERCENT > 50 < / PERCENTAGE >
< BIRTH_DT > 19800101 < / BIRTH_DT >
< dmnPERNSEXCD = "XX" SEX > male < / TYPE >
< NATLIDNO > TH000002 < / NATLIDNO >
< / recipients >
< / BeneficiaryInfo >
< survey >
< HealthDeclaration >
< question >
Q001 < QUESTION_ID > < / QUESTION_ID >
< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >
< / question >
< question >
Q002 < QUESTION_ID > < / QUESTION_ID >
< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >
< / question >
< question >
Q003 < QUESTION_ID > < / QUESTION_ID >
< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >
< / question >
< question >
Q004 < QUESTION_ID > < / QUESTION_ID >
< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >
< / question >
< question >
Q005 < QUESTION_ID > < / QUESTION_ID >
< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >
< / question >
< / HealthDeclaration >
< / questionnaire >
< / ApplicationRq >
< ApplicationRs >
<-reason for the rejection / >
< / ApplicationRs >
< / NewBusinessApplication >
');
l_xsd xmltype: = xmltype (' <? xml version = "1.0" encoding = "windows-1252"? >)
"< xsd: Schema container ="http://www.w3.org/2001/XMLSchema"xmlns ="http://www.example.org"
targetNamespace ="http://www.example.org" elementFormDefault = "qualified" > "
< xsd: element name = "NewBusinessApplication" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "TransactionHeader" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "TR_REF_NO" type = "xsd: Integer" / >
< xsd: element name = "EFF_DT" type = "xsd: String" / >
< xsd: element name = "SRC_SYS_CD" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnSRC_SYSTEM" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ApplicationRq" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "ApplInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "APPLNO" type = "xsd: String" / >
< xsd: element name = "MED_NONMED" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnMED_NONMED" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "APPL_DT" type = "xsd: Integer" / >
< xsd: element name = "EFF_DT" type = "xsd: Integer" / >
< xsd: element name = "APPL_RECV_DT" type = "xsd: Integer" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "AgentInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "The Agent" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "AGT_CD" type = "xsd: String" / >
< xsd: element name = "FIRSTNAME" type = "xsd: String" / >
< xsd: element name = "NAME" type = "xsd: String" / >
< xsd: element name = "AGT-LICNO" type = "xsd: String" / >
< xsd: element name = "TEAM" type = "xsd: String" / >
< xsd: element name = "TEAMLEADER" type = "xsd: String" / >
< xsd: element name = "TEAMLEADER-LICNO" type = "xsd: String" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "InsuredInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = 'PREFIX-TH' >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERS_NAMEPREFIX" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NAME-TH" type = "xsd: String" / >
< xsd: element name = "MIDNAME-TH" type = "xsd: String" / >
< xsd: element name = "LASTNAME-TH" type = "xsd: String" / >
< xsd: element name = "FORMERNAME" type = "xsd: String" / >
< xsd: element name = "PREFIX-FR" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERS_NAMEPREFIX-EN" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NAME-IN" type = "xsd: String" / >
< xsd: element name = "MIDNAME-EN" type = "xsd: String" / >
< xsd: element name = "LASTNAME-IN" type = "xsd: String" / >
< xsd: element name = "BIRTH_DT" type = "xsd: Integer" / >
< xsd: element name = "ÂGE" type = "xsd: Integer" / >
< xsd: element name = "GENDER" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERNSEXCD" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "MARITAL_STATUS" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERC_MAR_STAT_CD" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "RACE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnRACE" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "RELIGION" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnRELIGION" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NATIONALITY" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnNATIONALITY" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ID-TYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnIDTYPE" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ID" type = "xsd: String" / >
< xsd: element name = "ID-XPIR_DT" type = "xsd: Integer" / >
< xsd: element name = "OCCUPATION" >
< xsd: complexType >
< xsd: attribute name = "dmnOCCUP_CD" type = "xsd: String" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "OCCUP_CLASS" >
< xsd: complexType >
< xsd: attribute name = "dmnOCCUP_CLASS_CD" type = "xsd: String" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ANNUAL_INCOME" type = "xsd: Integer" / >
< xsd: element name = "HEIGHT" type = "xsd: Integer" / >
< xsd: element name = "WEIGHT" type = "xsd: Integer" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ProposerInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = 'PREFIX-TH' >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERS_NAMEPREFIX" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NAME-TH" type = "xsd: String" / >
< xsd: element name = "MIDNAME-TH" type = "xsd: String" / >
< xsd: element name = "LASTNAME-TH" type = "xsd: String" / >
< xsd: element name = "FORMERNAME" type = "xsd: String" / >
< xsd: element name = "PREFIX-FR" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERS_NAMEPREFIX-EN" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NAME-IN" type = "xsd: String" / >
< xsd: element name = "MIDNAME-EN" type = "xsd: String" / >
< xsd: element name = "LASTNAME-IN" type = "xsd: String" / >
< xsd: element name = "BIRTH_DT" type = "xsd: Integer" / >
< xsd: element name = "ÂGE" type = "xsd: Integer" / >
< xsd: element name = "GENDER" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERNSEXCD" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "MARITAL_STATUS" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERC_MAR_STAT_CD" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "RACE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnRACE" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "RELIGION" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnRELIGION" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NATIONALITY" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnNATIONALITY" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ID_TYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnIDTYPE" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ID_NUMBER" type = "xsd: String" / >
< xsd: element name = "ID_XPIR_DT" type = "xsd: Integer" / >
< xsd: element name = "OCCUPATION" >
< xsd: complexType >
< xsd: attribute name = "dmnOCCUP_CD" type = "xsd: String" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "OCCUP_CLASS" >
< xsd: complexType >
< xsd: attribute name = "dmnOCCUP_CLASS_CD" type = "xsd: String" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ANNUAL_INCOME" type = "xsd: Integer" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ContactInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "AddressInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Address" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "ADDRTYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnADDR_ADDRTYPE" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PRIMARY_CONTACT" type = "xsd: Integer" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PhoneInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Phone" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "PHONETYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnADRP_PHONETYPE" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PHONENUM" type = "xsd: Integer" / >
< xsd: element name = "PRIMARY_CONTACT" type = "xsd: Integer" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "EmailInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Email" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "EMAILTYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnADRO_EMAILTYPE" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "EMAILDATA" type = "xsd: String" / >
< xsd: element name = "PRIMARY_CONTACT" type = "xsd: Integer" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PolicyInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "BASE-PLAN_CD" type = "xsd: String" / >
< xsd: element name = "BASE-PLAN_NM" type = "xsd: String" / >
< xsd: element name = "MODEOFPAYMENT" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnZZFREQUENCY" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "BASE - SA" type = "xsd: float" / >
< xsd: element name = "BASE-PREMIUM" type = "xsd: float" / >
< xsd: element name = "BASE-MODALPREMIUM" type = "xsd: float" / >
< xsd: element name = "AYFP" type = "xsd: float" / >
< xsd: element name = "RiderInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Rider" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "RIDER-CODE" type = "xsd: String" / >
< xsd: element name = "RIDER-NAME" type = "xsd: String" / >
< xsd: element name = "RIDER - SA" type = "xsd: float" / >
< xsd: element name = "RIDER-PREMIUM" type = "xsd: float" / >
< xsd: element name = "RIDER-MODALPREMIUM" type = "xsd: float" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PaymentInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Bordered" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "TMP_RECEIPT_NO" type = "xsd: String" / >
< xsd: element name = "TOTAL_PYMT_AMT" type = "xsd: float" / >
< xsd: element name = "Payment" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "PAYER" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPAYRTYPE" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "TYPE PYMT" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPaymentType" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PYMT-AMT" type = "xsd: float" / >
< xsd: element name = "PYMT-Channel" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "CreditCard" minOccurs = "0" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "CARD TYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnCardType" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "CARD-NO" type = "xsd: Integer" / >
< xsd: element name = "CARD-HOLDERNAME" type = "xsd: String" / >
< xsd: element name = "CARD-BANKNM" type = "xsd: String" / >
< xsd: element name = "CARD-DISPLAYED" type = "xsd: String" / >
< xsd: element name = "CARD-AUTHCODE" / >
< xsd: element name = "CARD-AUTHDATE" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Bank" minOccurs = "0" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "BANK CODE" / >
< xsd: element name = "BANK-BRANCH" / >
< xsd: element name = "BANK-ACCNO" / >
< xsd: element name = "BANK-ACCNAME" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Cheque" minOccurs = "0" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "CHQ - NO" / >
< xsd: element name = "CHQ-DATE" / >
< xsd: element name = "CHQ-ISSUEBANK" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "RenewalPayment" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "PAYER" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPAYRTYPE" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "DDCHANNEL" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPaymentType" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "DDCDetails" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "CARD TYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnCardType" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "CARD-NO" type = "xsd: Integer" / >
< xsd: element name = "CARD-HOLDERNAME" type = "xsd: String" / >
< xsd: element name = "CARD-BANKNM" type = "xsd: String" / >
< xsd: element name = "CARD-DISPLAYED" type = "xsd: String" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "DDADetails" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "BANK-ACCTYPE" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnBNK_TYP_CD" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "BANK-ACCNO" / >
< xsd: element name = "BANK-ACCNAME" / >
< xsd: element name = "BANK-BRANCH" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "BeneficiaryInfo" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Recipient" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "RELATIONSHIP" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnBENE_RELT_CD" type = "xsd: Integer" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "FIRSTNAME" type = "xsd: String" / >
< xsd: element name = "MIDNAME" type = "xsd: String" / >
< xsd: element name = "NAME" type = "xsd: String" / >
< xsd: element name = "PERCENTAGE" type = "xsd: Integer" / >
< xsd: element name = "BIRTH_DT" type = "xsd: Integer" / >
< xsd: element name = "GENDER" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnPERNSEXCD" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "NATLIDNO" type = "xsd: String" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Questionnaire" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "HealthDeclaration" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Issue" maxOccurs = "unbounded" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "QUESTION_ID" type = "xsd: String" / >
< xsd: element name = "ANSWER" >
< xsd: complexType >
< xsd:simpleContent >
< xsd:extension base = "XSD: String" >
< xsd: attribute name = "dmnZZYESNO_NUM" type = "xsd: String" / >
< / xsd:extension >
< / xsd:simpleContent >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "ApplicationRs" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: element name = "Reason for rejection" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< / xsd: SEQUENCE >
< xsd: attribute name = "xsi" type = "xsd: String" / >
< xsd: attribute name = "schemaLocation" type = "xsd: String" / >
< / xsd: complexType >
< / xsd: element >
< / xsd: Schema >
');
BEGIN
dbms_output.put_line (Ali$ XML_VALID (l_xml, l_xsd));
END;
and please do not confused, you don't need to answer if I do not any sense.
BUT I STILL HAVE ONE LAST QUESTION
do you know how to use namespaces in the exctractvalue().
I'm not "troubled", just frustrated that you don't seem to understand what I've explained so far.
Why do you insist on the use of extractvalue? Don't use extractvalue, it is deprecated, use XMLTABLE instead.
If you feel compelled to use extractvalue of certain grounds, just the curiosity to seek it in the documentation, you can find the syntax to use the namespaces:
http://docs.Oracle.com/CD/E11882_01/server.112/e41084/functions061.htm#SQLRF06173
in your last code, you first insert the XML and extract data from it. I can do it too, but it's not my requirement. I'm supposed to read the first xml (if it is valid) as I do in my code using the table function and make the continuation of the procedure.
Look, I'll ask you one last time:
What problem are you having? What prevents you from first reading, certain values before inserting, as you need. Just use the same query XMLTABLE that I showed in my example, except you will not query the table, but directly from the XMLType variable:
PASSAGE v_xml
COLUMNS...
-
XML with XSD validation when there is more than one XSD.
Hello
I need to validate an XML against a set of xsd.
I am aware that, when there is a single XSD to compare, it is possible to compare using xmlDoc.schemaValidate () with xmlDoc and xmlSchema.
But in my case, there is more than one XSD against which I need to compare the XML code.
My main XSD has the statement as mentioned below.
" < xs: import namespace = ' http://www.w3.org/1999/xxxx "schemaLocation ="xxxx.xsd"/ > "
" < xs: import namespace = ' http://www.w3.org/1999/02/yyyy "schemaLocation ="yyyy.xsd"/ > "
I don't know how to handle this situation.
Please, help me!
Thank you
Vicky
Hi Vicky,
This situation is not different, just validate the main schema.
But, to use the XMLType schemaValidate method, you must save the schema in the database (via the DBMS_XMLSCHEMA API).
If the main schema contains imports then these referenced schemas must be saved too.
To sum up: register all 3 patterns in their order of dependency, then you will be able to validate your XML with the main XSD code.
() dbms_xmlschema.registerSchema
schemaURL-online ,
for example 'xxxx.xsd' schemaDoc =>
local-online true
genTypes-online fake
genTables-online fake
enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE
) ;
-
building XPath with the XML with the Namespace using PL SQL
All trying to build the path to each node, when the XML code with no namespace, the following code works very well provide the result
1 ~/
2 ~ /Person/
3 ~ /Person/ âge /
4 ~ /Person/ homecity /
5 ~ /Person/ nom /
6 ~ /Person/ AccueilGuides/lat /
7 ~ /Person/ AccueilGuides/name /
8 ~ /Person/ homecity / long /
But when the XML is changed to
<person xmlns="urn:person" xmlns:lat="urn:lat">
<name>Rob</name>
<age>37</age>
<homecity>
<name>London</name>
<lat>123.000</lat>
<long>0.00</long>
</homecity>
</person>"
The result of the code below the performance translates into just below result
1~/
2~/person/
In the XML file above, XML namespace is not constant and varies for each XML. My requirement is to analyze the complete XML code, where I can read the XML with namespace and get the result that is mentioned below
1~/
2~/person/
3~/person/age/
4~/person/homecity/
5~/person/name/
6~/person/homecity/lat:lat/
7~/person/homecity/name/
8~/person/homecity/long/
Can you please help me solve the issue mentioned. Thanks in advance. -Code snippet below:
DECLARE
l_File VARCHAR2(32000) := '<person>
<name>Rob</name>
<age>37</age>
<homecity>
<name>London</name>
<lat>123.000</lat>
<long>0.00</long>
</homecity>
</person>';
l_Where_Clause VARCHAR2(100) := '/*';
l_Append_Var VARCHAR2(100) := '/';
TYPE Ty_Paths IS TABLE OF VARCHAR2(1000) INDEX BY PLS_INTEGER;
l_Ty_Paths Ty_Paths;
l_Ty_Paths_Temp Ty_Paths;
TYPE Ty_Verifier IS TABLE OF VARCHAR2(1000) INDEX BY VARCHAR2(1000);
l_Ty_Varifier Ty_Verifier;
l_Prev_Query_Rec VARCHAR2(100);
l_Index_Num NUMBER := 0;
l_Cur_Exec_Row NUMBER := 0;
BEGIN
l_Ty_Paths(Nvl(l_Ty_Paths.COUNT, 0) + 1) := l_Append_Var;
l_Cur_Exec_Row := 1;
--Dbms_Output.put_line('Before entering the loop');
LOOP
l_Ty_Paths_Temp.DELETE;
SELECT DISTINCT REPLACE(l_Append_Var || '/' || t.Xml || '/', '//', '/') BULK COLLECT
INTO l_Ty_Paths_Temp
FROM (SELECT Xmltype(Extract(VALUE(e), '/').Getstringval()) .Getrootelement() AS Xml
FROM TABLE(Xmlsequence(Extract(Xmltype(l_File), l_Where_Clause))) e) t;
l_Ty_Varifier(Nvl(l_Ty_Varifier.COUNT, 0) + 1) := l_Append_Var;
--Dbms_Output.put_line('L_TY_PATHS_TEMP.Count::'||L_TY_PATHS_TEMP.Count);
IF l_Ty_Paths_Temp.COUNT > 0 THEN
l_Index_Num := Nvl(l_Ty_Paths.COUNT, 0) + 1;
FOR i IN l_Ty_Paths_Temp.FIRST .. l_Ty_Paths_Temp.LAST LOOP
l_Ty_Paths(l_Index_Num) := l_Ty_Paths_Temp(i);
--Dbms_Output.put_line('L_INDEX_NUM::'||L_INDEX_NUM);
--Dbms_Output.put_line('L_TY_PATHS(L_INDEX_NUM)::'||L_TY_PATHS(L_INDEX_NUM));
l_Index_Num := l_Index_Num + 1;
END LOOP;
END IF;
--Dbms_Output.put_line('L_TY_PATHS.Count::'||L_TY_PATHS.Count);
--Dbms_Output.put_line('L_TY_PATHS.Count::'||L_CUR_EXEC_ROW);
IF (NOT l_Ty_Paths.EXISTS(l_Cur_Exec_Row + 1)) OR (l_Cur_Exec_Row = l_Ty_Paths.COUNT) THEN
--Dbms_Output.put_line('Exiting');
EXIT;
ELSE
--Dbms_Output.put_line('Inside the Else part');
l_Cur_Exec_Row := l_Cur_Exec_Row + 1;
l_Append_Var := l_Ty_Paths(l_Cur_Exec_Row);
l_Where_Clause := l_Ty_Paths(l_Cur_Exec_Row) || '*';
END IF;
--To Display the record:
--Dbms_Output.put_line(L_TY_PATHS.Count);
END LOOP;
IF l_Ty_Paths.COUNT > 0 THEN
FOR i IN l_Ty_Paths.FIRST .. l_Ty_Paths.LAST LOOP
Dbms_Output.Put_Line(i || ' record is ' || l_Ty_Paths(i));
END LOOP;
END IF;
END;
Thank you.
If you have patterns, it may be easier to work directly on them.
Here's the idea:
(1) install "Oracle XML DB manageability Packages", available on the code page for the XML DB sample: http://download.oracle.com/otn/samplecode/xdb_util.zip
This is a set of utilities which allows us to annotate the XML schemas, to deal with the underlying or storage structure, and (this is the interesting part here) a few views of dictionary to describe the relational XSD structure.
(it is now an integrated 12 c btw)
(2) enter these two schemas:
Start
() dbms_xmlschema.registerSchema
schemaURL-online "pacs.002.001.03S2.xsd."
schemaDoc-online xmltype (bfilename('TEST_DIR','pacs.002.001.03S2.xsd'), nls_charset_id ('AL32UTF8'))
local-online true
genTypes-online fake
genTables-online fake
enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE
options-online dbms_xmlschema. REGISTER_BINARYXML
);
end;
/
Start
() dbms_xmlschema.registerSchema
schemaURL-online "SCTCvfBlkCredTrf.xsd."
schemaDoc-online xmltype (bfilename('TEST_DIR','SCTCvfBlkCredTrf.xsd'), nls_charset_id ('AL32UTF8'))
local-online true
genTypes-online fake
genTables-online fake
enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE
options-online dbms_xmlschema. REGISTER_BINARYXML
);
end;
/
(3) the following query built all the paths of node defined by the main schema (SCTCvfBlkCredTrf.xsd), as well as the namespaces:
with schema_list (schema_url, schema_owner) as)
Select 'SCTCvfBlkCredTrf.xsd', 'OTN' from dual
Union of all the
Select sd.dep_schema_url, sd.dep_schema_owner
of schema_list sl
Join dba_xml_schema_dependency on sd.schema_url = sl.schema_url sd
and sd.schema_owner = sl.schema_owner
),
namespace_mapping (target_namespace, prefix) as long as)
Select target_namespace
, « ns » || ROW_NUMBER() (order target_namespace) as a prefix
of user_xml_schema_namespaces
where schema_url in (select schema_url from schema_list)
),
() schema_nodes
is_attr
node_name
max_occurs
element_id
parent_element_id
target_namespace
schema_url
) as)
Select 0
element_name as node_name
xmlcast)
XMLQUERY ('/ XS: ELEMENT / ' @maxOccurs passing returning content element)
as varchar2 (10)
)
element_id
parent_element_id
target_namespace
schema_url
of user_xml_schema_elements
where schema_url in (select schema_url from schema_list)
Union of all the
Select 1
attribute_name as node_name
null
null
element_id
target_namespace
schema_url
of user_xml_schema_attributes
where schema_url in (select schema_url from schema_list)
)
Select the level
sn.node_name
sn.max_occurs
connect_by_isleaf as is_leaf
sys_connect_by_path)
-case when ns.prefix is not null and is_attr = 0 then ns.prefix | ':' end |
-case when sn.is_attr = 1 then ' @' end |
SN. NODE_NAME
, '/'
) as xpath
-, target_namespace
of schema_nodes sn
outer join ns namespace_mapping let ns.target_namespace = sn.target_namespace
Connect prior sn.element_id = sn.parent_element_id
Start with sn.schema_url = "SCTCvfBlkCredTrf.xsd".
and sn.parent_element_id is null
;
LEVEL MAX_OCCURS IS_LEAF XPATH NODE_NAME
----- ------------------ ---------- ------- ----------------------------------------------------------------------------------------------------------
1 SCTCvfBlkCredTrf 0 /ns2:SCTCvfBlkCredTrf
2 1 SndgInst /ns2:SCTCvfBlkCredTrf / ns2:SndgInst
2 1 RcvgInst /ns2:SCTCvfBlkCredTrf / ns2:RcvgInst
2 1 SrvcId /ns2:SCTCvfBlkCredTrf / ns2:SrvcId
2 1 TstCode /ns2:SCTCvfBlkCredTrf / ns2:TstCode
2 FType 1 /ns2:SCTCvfBlkCredTrf / ns2:FType
2 FileRef 1 /ns2:SCTCvfBlkCredTrf / ns2:FileRef
2 1 FileDtTm /ns2:SCTCvfBlkCredTrf / ns2:FileDtTm
2 1 OrigFRef /ns2:SCTCvfBlkCredTrf / ns2:OrigFRef
2 1 OrigFName /ns2:SCTCvfBlkCredTrf / ns2:OrigFName
2 1 OrigDtTm /ns2:SCTCvfBlkCredTrf / ns2:OrigDtTm
2 1 FileRjctRsn /ns2:SCTCvfBlkCredTrf / ns2:FileRjctRsn
2 1 FileBusDt /ns2:SCTCvfBlkCredTrf / ns2:FileBusDt
2 1 FileCycleNo /ns2:SCTCvfBlkCredTrf / ns2:FileCycleNo
2 FIToFIPmtStsRptS2 1 /ns2:SCTCvfBlkCredTrf 0 / ns2:FIToFIPmtStsRptS2
3 GrpHdr 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr
4 MsgId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:MsgId
4 CreDtTm 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:CreDtTm
4 InstgAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:InstgAgt
5 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:InstgAgt / ns1:FinInstnId
6 BIC 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:GrpHdr / ns1:InstgAgt / ns1:FinInstnId / ns1:BIC
3 OrgnlGrpInfAndSts 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts
4 OrgnlMsgId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlMsgId
4 OrgnlMsgNmId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlMsgNmId
4 OrgnlNbOfTxs 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlNbOfTxs
4 OrgnlCtrlSum 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:OrgnlCtrlSum
4 GrpSts 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:GrpSts
4 StsRsnInf 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf
5 Orgtr 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr
6 id 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id
7 OrgId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId
8 1 BICOrBEI /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId / ns1:BICOrBEI
5 ARS 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Rsn
6 Cd 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Cd
6 Prtry 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Prtry
4 NbOfTxsPerSts 2 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts
5 1 DtldNbOfTxs /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts / ns1:DtldNbOfTxs
5 1 DtldSts /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts / ns1:DtldSts
5 1 DtldCtrlSum /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:OrgnlGrpInfAndSts / ns1:NbOfTxsPerSts / ns1:DtldCtrlSum
3 TxInfAndSts boundless 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts
4 StsId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsId
4 OrgnlInstrId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlInstrId
4 OrgnlEndToEndId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlEndToEndId
4 OrgnlTxId 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxId
4 TxSts 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:TxSts
4 StsRsnInf 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf
5 Orgtr 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr
6 id 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id
7 OrgId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId
8 1 BICOrBEI /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Orgtr / ns1:Id / ns1:OrgId / ns1:BICOrBEI
5 ARS 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Rsn
6 Cd 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Cd
6 Prtry 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:StsRsnInf / ns1:Rsn / ns1:Prtry
4 InstdAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:InstdAgt
5 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:InstdAgt / ns1:FinInstnId
6 BIC 1 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:InstdAgt / ns1:FinInstnId / ns1:BIC
4 OrgnlTxRef 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef
5 IntrBkSttlmAmt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:IntrBkSttlmAmt
CTL 6 1 /ns2:SCTCvfBlkCredTrf/ns2:FIToFIPmtStsRptS2/ns1:TxInfAndSts/ns1:OrgnlTxRef/ns1:IntrBkSttlmAmt/@Ccy
5 1 IntrBkSttlmDt /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:IntrBkSttlmDt
5 DbtrAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:DbtrAgt
6 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:DbtrAgt / ns1:FinInstnId
7 1 BIC /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:DbtrAgt / ns1:FinInstnId / ns1:BIC
5 CdtrAgt 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:CdtrAgt
6 FinInstnId 0 /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:CdtrAgt / ns1:FinInstnId
7 1 BIC /ns2:SCTCvfBlkCredTrf / ns2:FIToFIPmtStsRptS2 / ns1:TxInfAndSts / ns1:OrgnlTxRef / ns1:CdtrAgt / ns1:FinInstnId / ns1:BICIn fact, you would be generally extracted from mapping data in a separate query so that you can use it to build the dynamic with XMLNamespaces clause of the namespace.
NB1: Also note that not all roads are needed, only those which IS_LEAF = 1 or MAX_OCCURS = "unlimited" or MAX_OCCURS > '1', then you can add a filter predicate in the query directly.
NB2: The query does support all the features of XSD, for example, I've relied on the default behavior for attributes 'element_form_default' and 'attribute_form_default '.
-
Hi guys,.
I want to read XML and tried with query below. But ' < requestedCompletionDate > 2011' value doesn't show up.
Please can anyone suggest where it goes wrong.
select x.requestedCompletionDate from TABLE_X_JMS_MSG xjm ,XMLTABLE(XMLNamespaces( 'http://www.metasolv.com/oss/ServiceActivation/2003' as "mslv-sa" , 'http://java.sun.com/products/oss/xml/Common' as "co" , 'http://www.w3.org/2001/XMLSchema-instance' as "xsi") , '/createOrderByValueRequest' PASSING XMLTYPE(XJM.X_MSG_XML) COLUMNS requestedCompletionDate timestamp PATH 'orderValue xsi:type="mslv-sa:ASAPOrderValue"/requestedCompletionDate' ) x WHERE XJM.X_MSG_XML LIKE '%DDDD_1MC%' AND XJM.objid = '269738342'
See you soon<?xml version="1.0" encoding="UTF-8"?> <createOrderByValueRequest xmlns="http://java.sun.com/products/oss/xml/ServiceActivation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co="http://java.sun.com/products/oss/xml/Common" xmlns:mslv-sa="http://www.metasolv.com/oss/ServiceActivation/2003" xmlns:serviceStatus="http://boss.clarify.com/ServiceStatus/v7.0" xmlns:extRef="http://boss.clarify.com/ExternalRef/v7.0" xmlns:mna="http://boss.clarify.com/capabilities/ManageNetworkActivation/v7.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sh="http://boss.clarify.com/2005/06/StandardHeader/"> <orderValue xsi:type="mslv-sa:ASAPOrderValue"> <apiClientId>OM-AAAMOB</apiClientId> <orderKey> <co:applicationContext> <co:factoryClass /> <co:url /> <co:systemProperties /> </co:applicationContext> <co:type /> <primaryKey>SUAUG31_1MC-2685883PEI1</primaryKey> </orderKey> <priority>3</priority> <requestedCompletionDate>2011-08-31T17:42:10</requestedCompletionDate> <services> <item xsi:type="mslv-sa:ASAPService"> <serviceKey xsi:type="mslv-sa:ASAPServiceKey"> <co:applicationContext> <co:factoryClass /> <co:url /> <co:systemProperties /> </co:applicationContext> <co:applicationDN /> <co:type>ASTPAID</co:type> <primaryKey>ait721661001</primaryKey> <mslv-sa:serviceSequenceNumber>1</mslv-sa:serviceSequenceNumber> </serviceKey> <mslv-sa:serviceValues> <mslv-sa:serviceValue xsi:type="mslv-sa:ASAPServiceValue"> <mslv-sa:name>PROFILE</mslv-sa:name> <mslv-sa:value>2</mslv-sa:value> <mslv-sa:type>REQUIRED_SCALAR</mslv-sa:type> </mslv-sa:serviceValue> <mslv-sa:serviceValue xsi:type="mslv-sa:ASAPServiceValue"> <mslv-sa:name>MSNN</mslv-sa:name> <mslv-sa:value>0000904</mslv-sa:value> <mslv-sa:type>REQUIRED_SCALAR</mslv-sa:type> </mslv-sa:serviceValue> </mslv-sa:serviceValues> </item> </services> <mslv-sa:parentKey> <co:applicationContext> <co:factoryClass /> <co:url /> <co:systemProperties /> </co:applicationContext> <co:applicationDN /> <co:type /> <primaryKey /> </mslv-sa:parentKey> <mslv-sa:origin>ASC Test Orders</mslv-sa:origin> <mslv-sa:organizationUnit>sddddwe</mslv-sa:organizationUnit> <mslv-sa:rollbackIfFail>true</mslv-sa:rollbackIfFail> <mslv-sa:batchGroup /> <mslv-sa:externalSystemId>AWWWCS</mslv-sa:externalSystemId> <mslv-sa:srqAction>ADD</mslv-sa:srqAction> <mslv-sa:orderParameters /> <mslv-sa:infoParms /> <mslv-sa:extendedWoProperties /> </orderValue> </createOrderByValueRequest>
SexyHello
Missing of the default namespace, which is actuallly the only one you need here.
The prefix xsi is pre-defined so that you do not need to declare no more:
http://download.Oracle.com/docs/CD/E11882_01/AppDev.112/e16659/xdb_xquery.htm#CBAJBDFAThe XPath expression in the COLUMNS clause was wrong too.
You can try this one (not tested, I don't have the correct version of db right now):
SELECT x.requestedCompletionDate FROM TABLE_X_JMS_MSG xjm , XMLTABLE( XMLNamespaces(default 'http://java.sun.com/products/oss/xml/ServiceActivation') , '/createOrderByValueRequest' PASSING XMLTYPE(XJM.X_MSG_XML) COLUMNS requestedCompletionDate timestamp PATH 'orderValue[@xsi:type="mslv-sa:ASAPOrderValue"]/requestedCompletionDate' ) x WHERE XJM.X_MSG_XML LIKE '%DDDD_1MC%' AND XJM.objid = '269738342' ;
Hope that helps.
-
Different users accessing the data with different rights
Hello
I just started with Oracle and I don't know if
This is the right way for what I was intending.
I want to allow access to the data (tables, views,...) to different users with different rights.
For example a user with select only the rights and another with select and insert rights.
Database Oracle 10 g Express Edition is.
Here are the steps I did:
-This user will be allowed to select only
create user UserSelectOnly...;
-This user will have select and insert privileges
create user UserSelectAndInsert...;
-This user only contains data
create user BaseDB...;
-creation of test in BaseDB data
create the table tdTest (...);
-definition of role in BaseDB for right to select
create the role RoleSelectOnly;
-granting SELECT privilege for RoleSelectOnly
Grant select on tdTest to RoleSelectOnly;
-select grant (role) to the user UserSelectOnly
grant RoleSelectOnly to UserSelectOnly;
-definition of role in BaseDB to select and insert privileges
create the role RoleSelectAndInsert;
-grant select and insert privilege for RoleSelectAndInsert
Grant select, insert on tdTest to RoleSelectAndInsert;
-grant select and insert (role) to the user UserSelectAndInsert
grant RoleSelectAndInsert to UserSelectAndInsert;
My problem is that the definition of user (BaseDB) works as a database.
Are there more effective ways in Oracle 10 g Express?
Thank you
WilfriedHello Wilfried and welcome to the forum.
First of all, it's a property that you have given time to review the security of the database.
My immediate comments:
You have 3 users:
-This user only contains data
create user BaseDB...;Very well, good thing. Use an administrative account/data owner.
You might consider locking when you do not have administrative tasks in the schema.-This user will be allowed to select only
create user UserSelectOnly...;-This user will have select and insert privileges
create user UserSelectAndInsert...;OK, but no need to take account of their privileges in the names. You could simply call their
SomeUser
AnotherUserYou have two roles
-definition of role in BaseDB for right to select
create the role RoleSelectOnly;-definition of role in BaseDB to select and insert privileges
create the role RoleSelectAndInsert;Seems ok, it's a good thing here for the description of privileges in the role itself.
Maybe I would call them something like
RoleSelect or RoleRead or BaseDBSelectRole
RoleInsert or RoleWrite or BaseDBUpdateRoleShould be updated (and DELETE), as well?
Another approach would be to separate between the tables.
For a group of tables, select, insert, update, delete are granted to a role.
For another group of tables, different privileges are granted to another role.
That is, there is no general answer, correct, it depends on your application.
Often the roles are used for ease of maintenance. In other words, if you have several users who need
the same set of privilege, these are maintained by a role.Maybe you don't want to use roles, but I like them.
But attention not onlySelect on all tables to a single role
Insert on every table to another role
Update on all tables to a third party role.Unless, of course, it gives meaning to your scenario.
My problem is that the definition of user (BaseDB) works as a database.
Are there more effective ways in Oracle 10 g Express?Not sure what you mean. Schema in Oracle and user are often used for the same thing.
In your case, BaseDB is the owner of (all) the tables, no problem.
As mentioned, you might choose to block the account.The main thing is, no application, or ad-hoc user should log in as BaseDB
And the users of your system should be exactly the privileges they need to do their jobs
nothing more, nothing less.Concerning
Peter
Maybe you are looking for
-
Zero readings of strain at the beginning of a test using the Daq Assistant
I worked on code that uses the wizard daqmx for reading and writing of strain, temperature and voltage of a cdaq-9174, with NI 9211 and NI 9237 cards. Everything works fine in the code, but I want to be able to zero distortion at the beginning of a
-
I have a problem with the connection of the speakers.
Original title: speakers... Speakers were disconnected from the back of the computer, and I know not where/how plug them back in, and the speaker in the taskbar icon has a red x on it with this message 'the device does not appear to be connected' whe
-
Linksys EA6900 - cannot access external hard drive USB USB1 of more
Linksys Firmware 1.1.42.161129 Ea6900 I had a Linksys EA6900 router for the last 6 months. I had 2 USB 3.0 4 TB drives Seagate external hard connected to the back of the router USB1 - 4 TB Media USB2 - 4 TB Backup Things worked very well, but I got
-
T61 (7659-D22): disable, remove, or replace the WWAN card?
My T61 (7659-D22) la Sierra Wireless to Verizon, but I have no Verizon or another data plan. What is I can disable the Sierra card so it is not sucking power? I can remove it without the machine complaining? Is there a more useful map that I can inst
-
How can I return my computer to the factory setting.
How can I return my computer to the factory setting.