the output of XML validation against the XML schema for the Oracle

Hi all
We have a requirement where we need to extract all the data from the client to the format of OIOXML (standard at the Denmark) and FTP data for data buyers. I need some information about how we can generate an XML in the specified format of user and validate the XML generated using Oracle Pl/Sql. Once a week we FTP almost 1 million documents, is possible to validate all data that we send. Please provide some guidance.

Oracle version: 9.2.0.8

Thanks in advance
Rambeau

Published by: user584123 on May 30, 2009 08:39

user584123 wrote:
Please respond to my query

I thought I already did.
You ask in the right forum.

Tags: Database

Similar Questions

  • Display the error when the xml document is not valid against the schema

    Hello

    I'm using isChemaValid() in a way that, to determine if the xml document is valid against the xml schema.

    This function returns only 0 or 1, and I want to display the error and the line number if the xml is not valid.

    How can I achieve this?

    Thanks in advance,

    Elad

    Use the XMLType schemaValidate() method. It will throw an exception whose message contains the validation error.

    Get a number of 'line' is not sensible as XML is concerned.

  • XML validation against the XSD schema

    Hi all

    I have a strange problem.

    I'm trying to validate an XMLTYPE variable against a XSD schema using the XMLisValid function.

    The XML code that I am trying to validate returned false (0) when you use this method.

    However, when I save the XSD against a column in a table, and then insert this XMLTYPE in this column, I don't get any errors. If I change the XSD to ensure failure when using this method, I get an error, if it is registered and work.

    I then created a very basic XSD and both methods work when validating XML against that. Then of course the XSD harder I want to validate against a difference, but I expect or them both don't both pass, not a failure and a single pass.

    Does anyone know why it would return different results?

    Thanks in advance for your help.

    Robin

    examples of what I use:

    XML to validate:

    <>centers
    < Add >
    <>Center
    < centreName > name 1 < / centreName >
    < centreRef > 45678 < / centreRef >
    < / Center >
    < / add >
    < / Center >

    Simple XSD:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xs: Schema attributeFormDefault = "unqualified" elementFormDefault = "qualified" xmlns: XS = "http://www.w3.org/2001/XMLSchema" >
    < xs: element name = "centres" type = "centresType" / >
    < name XS: complexType 'addType' = >
    < xs: SEQUENCE >
    < xs: ELEMENT type = "xs: String" name = "centreName" / >
    < xs: ELEMENT type = "xs:short" name = "centreRef" / >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < name XS: complexType = "centresType" >
    < xs: SEQUENCE >
    < xs: ELEMENT type = "addType" name = 'Add' maxOccurs = "3" minOccurs = "0" / >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: Schema >

    XSD complex:

    <? XML version = "1.0" encoding = "utf-8"? >
    <! - created with liquid XML Studio - 30 Day Trial Edition 7.1.6.1440 (http://www.liquid-technologies.com)->
    < xs: Schema attributeFormDefault = "unqualified" elementFormDefault = "qualified" xmlns: XS = "http://www.w3.org/2001/XMLSchema" >
    < xs: element name = "Center" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: element name = "Remove" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: ELEMENT minOccurs = "0" maxOccurs = "1000" name = "centreRef" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "50" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < xs: element name = "Add" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: ELEMENT minOccurs = "0" maxOccurs = "1000" name = "Center" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: element name = "centreName" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "100" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "centreRef" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "50" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: ELEMENT minOccurs = "0" maxOccurs = "1" name = "qualities" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: ELEMENT minOccurs = "0" maxOccurs = "1000" name = "qualRef" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "100" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < xs: element name = "modifyQualAssociations" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: element name = "Remove" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: ELEMENT minOccurs = "0" maxOccurs = "1000" name = "o" >
    < xs: complexType >
    < name XS: attribute = use "centreRef" = "required" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "50" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: attribute >
    < name XS: attribute = use "qualRef" = "required" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "100" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: attribute >
    < / xs: complexType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < xs: element name = "Add" >
    < xs: complexType >
    < xs: SEQUENCE >
    < xs: ELEMENT minOccurs = "0" maxOccurs = "1000" name = 'a' >
    < xs: complexType >
    < name XS: attribute = use "centreRef" = "required" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "50" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: attribute >
    < name XS: attribute = use "qualRef" = "required" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:minLength value = "1" / >
    < xs:maxLength value = "100" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: attribute >
    < / xs: complexType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: element >
    < / xs: Schema >

    Just had a quick glance at your XSD complex...

    
    
    

    You have a piece of 'delete' that is required as part of the sequence of elements with the element "centers." Yet your XML will fail validation compared with what it has only one item "add".

    Maybe your

    
    

    must be:

    
    

    ?

    Just guessing. ;)

  • Store XML in the schema issue generated tables and XML Validation against the schema.

    Hello friends,

    I am facing a problem where to store xml in a saved schema generated from tables.

    It's my diagram

    --

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < xs: schema xmlns:ds = ' http://www.w3.org/2000/09/xmldsig# "" xmlns: XS = " " http://www.w3.org/2001/XMLSchema "xmlns =" " http://www.ABC.inf.in/test "targetNamespace =" " http://www.abc.inf.in/test" elementFormDefault = "qualified" attributeFormDefault = "unqualified" > "

    < xs: include schemaLocation = "abc.xsd" / >

    < xs: element name = "project" type = 'student' >

    < xs: annotation >

    < Intention > it is a Documentation < / intention >

    < / xs: annotation >

    < / xs: element >

    < / xs: Schema >

    -This is my xml document

    "< project versão ="2.00"xmlns ="http://www.abc.inf.in/test">."

    "< test xmlns ="http://www.abc.inf.in/test">."

    " < intest version ="2.00"Id ="testabc"xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "  >

    < ide >

    < cUF > 35 < / cUF >

    < cNF > 59386422 < / cNF >

    < natOp > This is post < / natOp >

    < indPag > 1 < / indPag >

    < mod > 55 < / mod >

    < set > 1 < / series >

    < / ide >...

    .....................

    Giving not complete because it is too long.

    1. I registered successfully of the schemas in the database

    2. then I generate the saved schema table

    2. in my java code I have validated the document XML schema compared and it's valid successfully.

    3 but when I recorded this XML file in the generated table there me gives error

    As:

    INSERT INTO XMLTABLE

    VALUES

    (XMLTYPE (bfilename('MYDIR','testabc.xml'), NLS_CHARSET_ID ('AL32UTF8')))

    Error report:

    SQL error: ORA-31061: error XDB: XML error event

    ORA-19202: an error has occurred in the processing of XML

    LSX-00333: literal '94032000' is not valid with regard to the model

    And I have to store this xml in tables of this so what I have to do?

    Thanks for your reply odie_63.

    I got this my solution for the error. My XML document is not well structured based on my registered XML schema.

    Average in My XML Document is an invalid value and which do not match my schema model so it gives this error

    SQL error: ORA-31061: error XDB: XML error event

    ORA-19202: an error has occurred in the processing of XML

    LSX-00333: literal '94032000' is not valid with regard to the model

    For the Solution, we have two ways

    1. I changed this literal value "94032000" in my xml file, then save it.

    2.

    -To delete this schema can

    -We need to change the schema for the particular element model

    like: -.

    -then to store xml in the database, it works...

    Thank you.

  • In the Studio of BEA WorkSpace XML schema Validation error

    When I validate my XML schemas through the BEA WorkSpace Studio Version: version 1.1: 1090602 identifier the track happens error:

    Reference file contains errors (file:/MyPath/MyXMLSchema1.xsd).
    For more information, click with the right button on the message and select "show details...". »

    See details:
    The below errors were detected during the validation of the 'MyXMLSchema1.xsd' file via the file 'MyXMLSchema2.xsd '.
    In most cases, these errors can be detected by validating 'MyXMLSchema1.xsd' directly.
    However, it is possible that errors occur only when MyXMLSchema1.xsd is posted under MyXMLSchema2.xsd.

    CBC-resolve: could not resolve the name 'srv:Services' component 'type definition' a (e)

    When I validate my XML schemas through the oepe_11gR1PS4 (Eclipse platform Version: 3.6.2 Build id: M20110210-1200) no errors not found.

    My project is a (project ALSB) OSB.

    What is happen?

    BEA WorkSpace Studio Version: version 1.1: 1090602 identifier use xerces bea\alsb3.0\tools\eclipse_pkgs\1.1\eclipse_3.2.2\eclipse\plugins\org.apache.xerces_2.8.0.v200606131651

    oepe_11gR1PS4 (Eclipse platform Version: 3.6.2 Build id: M20110210-1200) use xerces Oracle\Middleware_10.3.5\oepe_11gR1PS4\plugins\org.apache.xerces_2.9.0.v201005080400.jar

    If you replace the follow-up files:
    bea\alsb3.0\tools\eclipse_pkgs\1.1\eclipse_3.2.2\eclipse\plugins\org. Apache.xerces_2.8.0.v200606131651\resolver.jar
    bea\alsb3.0\tools\eclipse_pkgs\1.1\eclipse_3.2.2\eclipse\plugins\org. Apache.xerces_2.8.0.v200606131651\xercesImpl.jar
    bea\alsb3.0\tools\eclipse_pkgs\1.1\eclipse_3.2.2\eclipse\plugins\org. Apache.xerces_2.8.0.v200606131651\xml-APIs.jar

    for:
    Oracle\Middleware_10.3.5\oepe_11gR1PS4\plugins\org. Apache.xerces_2.9.0.v201005080400.jar

    BEA WorkSpace Studio Version: version 1.1: 1090602 identifier is validated without errors (the same oepe_11gR1PS4 behavior)

  • Insert data as XML into the Oracle Table

    Hi all

    I have a requirement where the data in XML format, and I need to insert into the Oracle Table. For example, I get XML data in the following format,
    < results >
    < row >
    < BANK_ACCOUNT_ID > 10010 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    Vision operations < LEGAL_ENTITY > < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 10271-17621-619 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA-204 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 09 < / BALANCE_DATE >
    < LEDGER_BALANCE > 432705900.56 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10091 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300984 < / BANK_ID >
    Vision industries < LEGAL_ENTITY > < / LEGAL_ENTITY >
    Barclay Bank < BANK_NAME > < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 70986798 < / BANK_ACCOUNT_NUM >
    Bank Multi currency-626 < BANK_ACCOUNT_NAME > Barclays < / BANK_ACCOUNT_NAME >
    Reading < BRANCH_NAME > < / BRANCH_NAME >
    GBP < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 14 < / BALANCE_DATE >
    < LEDGER_BALANCE > 24244085.24 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10127 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    < LEGAL_ENTITY > SSC U.S. 01 < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 4898744 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA SSC U.S. 02-7188 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 28 < / BALANCE_DATE >
    < LEDGER_BALANCE > 10783815.28 < / LEDGER_BALANCE >
    < / row >
    < / results >

    I like to write PLSQL code that will receive these data with XML tags and insert it into the Oracle Table. Is this possible with built-in XML features provided in the Oracle database?

    Please Guide...

    Kind regards
    Priyanka

    But the problem is the file XML is to have the details of the records if you carefully observed the XML file. But by using more high statement select I get output in the following format.
    ORG_ID REQ_LINE PO_NUMBER EXPECTED_REC_QTY USER_NAME REQ_NUMBER
    204204 1444714450 11 64446445 11 OPERATIONSOPERATIONS

    The table has only one row, so you get a single row as output.
    I'm surprised that you find useful examples showing how to divide the data into several lines.

    (1) create the table with the following option, it will optimize the performance of storage and query for large XML documents:

    CREATE TABLE xxios_xml_data_test(xml_data XMLTYPE)
    XMLTYPE COLUMN xml_data STORE AS SECUREFILE BINARY XML
    ;
    

    (2) interview table with:

    SQL> select x.*
      2  from xxios_xml_data_test t
      3     , xmltable(
      4         '/Results/Row'
      5         passing t.xml_data
      6         columns ORG_ID           number       path 'ORG_ID'
      7               , REQ_NUMBER       number       path 'REQ_NUMBER'
      8               , REQ_LINE         number       path 'REQ_LINE'
      9               , PO_NUMBER        number       path 'PO_NUMBER'
     10               , EXPECTED_REC_QTY number       path 'EXPECTED_REC_QTY'
     11               , USER_NAME        varchar2(30) path 'USER_NAME'
     12       ) x
     13  ;
    
        ORG_ID REQ_NUMBER   REQ_LINE  PO_NUMBER EXPECTED_REC_QTY USER_NAME
    ---------- ---------- ---------- ---------- ---------------- ------------------------------
           204      14447          1       6444                1 OPERATIONS
           204      14450          1       6445                1 OPERATIONS
     
    
  • Import of XML in the oracle 11g database

    I have some difficulty parsing of an XML file in the oracle 11g database.

    Currently using Oracle 11 g Express Edition (XE)

    Here's how my XML file looks like this:


    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >
    -< AccountMap xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    -< account >
    -< AccountMapping >
    < AccountID > 0000000000000 - 000 < / AccountID >
    < AccountName > XLS < / AccountName >
    Excel < AccountType > < / AccountType >
    < AccountOwner > system < / AccountOwner >
    < / AccountMapping >
    -< AccountMapping >
    < AccountID > 0000000000000 - 001 < / AccountID >
    < AccountName > XLSS < / AccountName >
    Excel2 < AccountType > < / AccountType >
    System2 < AccountOwner > < / AccountOwner >
    < / AccountMapping >
    -< AccountMapping >

    and so now the file continues... I have the xml file that is saved on my hard drive

    I created a package in SQL Developer

    create or replace
    PACKAGE XML_FILEHANDLER AS

    type TRecord is (record
    Account_ID varchar2 (100)
    , Varchar2 (100) AccountName
    , Varchar2 (30) AccountType
    , AccountOwner varchar2 (100)
    );

    type TRecordTable is table of the TRecord;

    getRows function (p_directory in varchar2, p_filename in varchar2) return TRecordTable pipeline;

    END XML_FILEHANDLER;

    -BODY

    create or replace
    PACKAGE BODY XML_FILEHANDLER AS

    getRows function (p_directory in varchar2, p_filename in varchar2) return TRecordTable AS pipeline

    nb_rec NUMBER: = 1;
    tmp_xml CLOB.
    tmp_file CLOB.
    REC TRecord;

    BEGIN

    DBMS_LOB.CREATETEMPORARY (tmp_file, true);
    tmp_file: = dbms_xslprocessor.read2clob (p_directory, p_filename);

    recomm. Account_ID: = regexp_replace (tmp_file, '. * <>(. *) Account_ID < / Account_ID >. *', '\1', 1, 1, 'n');
    recomm. AccountName: = regexp_replace (tmp_file, '. * < AccountName >(.*) < / AccountName >. *', '\1', 1, 1, 'n');
    recomm. AccountType: = regexp_replace (tmp_file, '. * < AccountType >(.*) < / AccountType >. *', '\1', 1, 1, 'n');
    recomm. AccountOwner: = regexp_replace (tmp_file, '. * < AccountOwner >(.*) < / AccountOwner >. *', '\1', 1, 1, 'n');

    loop

    -This regexp is instance (s) of this model: "<? XML...? ' > < root_tag >... < / root_tag >.
    tmp_xml: = regexp_substr ([tmp_file, ' < \?xml[^?] +------? > \s+ < ([^ >] +) >. *? < / \1 > ', 1, nb_rec, 'n');
    When the output length (tmp_xml) = 0;
    -dbms_output.put_line (tmp_rec);
    nb_rec: = nb_rec + 1;

    SELECT Account_ID AccountName, AccountType, AccountOwner
    in rec. Account_ID, rec. AccountName, AccountType rec. rec. AccountOwner
    from xmltable)
    "Accounts/AccountMapping" in the way of xmltype (tmp_xml) columns
    Path of varchar2 (100) Account_ID 'Account_ID '.
    , Path of varchar2 (100) AccountName "AccountName".
    , AccountType varchar2 (30) path 'AccountType '.
    , Path of varchar2 (100) AccountOwner "AccountOwner.
    );

    line (CRE);

    end loop;

    DBMS_LOB.freeTemporary (tmp_file);

    GetRows END;

    END XML_FILEHANDLER;

    -I call my function using the following sql query

    Select * from table (XML_FileHandler.getRows ("XML", "test.xml"));

    Here is the error I get

    ORA-29283: invalid file operation
    ORA-06512: at "SYS." UTL_FILE", line 536
    ORA-29283: invalid file operation
    ORA-06512: at "XDB". DBMS_XSLPROCESSOR', line 265
    ORA-06512: at "user. XML_FILEHANDLER', line 13
    29283 00000 - "invalid file operation.
    * Cause: An attempt was made to read from a file or a directory which is
    not exist, or the file or directory access was denied by the
    Operating system.
    * Action: Check access privileges to the file and directory on the file system
    and if reading, check that the file exists.

    I did the following

    -Provided appropriate access to the user (read, write), including directory access rights
    -ensure that the directory exists
    -to ensure the existence of the file

    I have searched all over google and metalink but am unable to get this to run... Help, please!

    >
    SELECT Account_ID AccountName, AccountType, AccountOwner
    in rec. Account_ID, rec. AccountName, AccountType rec. rec. AccountOwner
    from xmltable)
    "Accounts/AccountMapping" in the way of xmltype (tmp_xml) columns
    Path of varchar2 (100) Account_ID 'Account_ID '.
    , Path of varchar2 (100) AccountName "AccountName".
    , AccountType varchar2 (30) path 'AccountType '.
    , Path of varchar2 (100) AccountOwner "AccountOwner.
    );
    >
    implement

    SELECT Account_ID, AccountName, AccountType, AccountOwner
    into rec.Account_ID, rec.AccountName, rec.AccountType, rec.AccountOwner
    from xmltable(
    'AccountMap/Accounts/AccountMapping' passing xmltype(tmp_xml) columns
    Account_ID varchar2(100) path 'Account_ID'
    , AccountName varchar2(100) path 'AccountName'
    , AccountType varchar2(30) path 'AccountType'
    , AccountOwner varchar2(100) path 'AccountOwner'
    );
    
    SQL> SELECT Account_ID, AccountName, AccountType, AccountOwner
      2  --into rec.Account_ID, rec.AccountName, rec.AccountType, rec.AccountOwner
      3  from xmltable(
      4  'AccountMap/Accounts/AccountMapping' passing
      5  xmltype('
      6  
      7  
      8  
      9  0000000000000-000
     10  XLS
     11  Excel
     12  System
     13  
     14  
     15  0000000000000-001
     16  XLSS
     17  Excel2
     18  System2
     19  
     20  
     21  ')
     22  columns
     23  Account_ID varchar2(100) path 'Account_ID'
     24  , AccountName varchar2(100) path 'AccountName'
     25  , AccountType varchar2(30) path 'AccountType'
     26  , AccountOwner varchar2(100) path 'AccountOwner'
     27  );
    
    ACCOUNT_ID                                                                       ACCOUNTNAME                                                                      ACCOUNTTYPE                    ACCOUNTOWNER
    -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------ --------------------------------------------------------------------------------
                                                                                     XLS                                                                              Excel                          System
                                                                                     XLSS                                                                             Excel2                         System2
    
    SQL> 
    

    AccountID use AccountID not Account_ID

    Account_ID varchar2(100) path 'AccountID'
    

    Published by: Alexandr on August 9, 2012 12:35 AM

  • XML from the Oracle Table data

    Hi all

    I'm new to this network. I'm also new to oracle XML package. I want a help with the query below.

    CREATE TABLE EMP (ID NUMBER PRIMARY KEY, NAME VARCHAR2 (10), TELEPHONE NUMBER);

    INSERT INTO EMP (ID, NAME, PHONE) VALUES (11, 'Joy', 1234);
    INSERT INTO EMP (ID, NAME, PHONE) VALUES (22, 'Mike', 5678).
    INSERT INTO EMP (ID, NAME, PHONE) VALUES (33, "Jason", NULL);
    COMMIT;

    I want to export data from the EMP table in an XML file with the format below.

    Power required:

    <? XML version = "1.0" encoding = "UTF-8"? > < Joy STATICDATA > < EMP > < ID > 11 < /ID > < NAME > < / NAME > < / EMP > < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? > < Mike STATICDATA > < EMP > < ID > 22 < /ID > < NAME > < / NAME > < / EMP > < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? > < Jason STATICDATA > < EMP > < ID > 33 < /ID > < NAME > < / NAME > < / EMP > < / STATICDATA >

    I used some XML functions and you wrote the following query.

    Select XMLROOT (XMLELEMENT (staticdata, XMLELEMENT (EMP, XMLELEMENT(ID,ID), XMLELEMENT(NAME,NAME))), version "1.0" encoding = "UTF - 8') xml EMP;

    my query output:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < STATICDATA >
    < EMP >
    < ID > 11 / < ID >
    Joy of < NAME > < / NAME >
    < / EMP >
    < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? >
    < STATICDATA >
    < EMP >
    < ID > 22 / < ID >
    < NAME > Mike < / NAME >
    < / EMP >
    < / STATICDATA >
    <? XML version = "1.0" encoding = "UTF-8"? >
    < STATICDATA >
    < EMP >
    < ID > 33 / < ID >
    Jason < NAME > < / NAME >
    < / EMP >
    < / STATICDATA >


    But I want the out as the power required above. all records in a single line. can someone help me achieve the desired output. also can I export all columns of the table with something like select * from the table in the XML file?

    Thank you
    Delobelle

    Don't know why you need it on a single line, but you could:

    Select XMLTYPE (REGEXP_REPLACE (XMLROOT (XMLELEMENT (staticdata, XMLELEMENT (EMP, XMLELEMENT(ID,ID), XMLELEMENT(NAME,NAME))), version "1.0" encoding = "UTF - 8'), CHR (10) |)) ' *<><'))>
    FROM EMP;

    SY.

  • Convert flat file to XML document and store it in the Oracle database

    First of all:
    I have a flatfile and created an external table to read this file in Oracle
    Now, I want to create an XML document for each line and insert in the Oracle database, I think as XMLtype.
    Could you please give me some information/steps.

    Second:
    Are there performance issues, because every day, I need to check that the XML document stored in the database against the next file.
    Thank you.

    I won't tell it not in the same words that Marco used, but your solution is impassable and an invitation for bad things to happen.

    Wait miserable performance, and you will not be disappointed.

    The concept of total flexibility works up a code that you depend on has no idea what to do with what is playback.
    Will happen to enough short term and is roughly the equivalent of the absurdity of Java to be independent of the database.

    I would recommend you take the concept and consider, with your data volumes, something more likely to succeed.

  • I am trying to save the xml schema and get error

    SQL > START
    (2) DBMS_XMLSCHEMA.registerSchema
    3 SCHEMAURL = > "http://www.fgdc.gov/metadata/fgdc-std-001-1998.dtd"
    4 SCHEMADOC = > bfilename('XMLDIR','fgdc-std-001-1998.dtd'),
    5 CSID = > nls_charset_id ('AL32UTF8'));
    6 END;
    6 N
    BEGIN
    *
    ERROR on line 1:
    ORA-31011: XML parsing failed
    ORA-19202: an error has occurred in the processing of XML
    LPX-00247: invalid declaration DTD (Document Type)
    Error on line 45
    ORA-06512: at "XDB". DBMS_XMLSCHEMA_INT', line 37
    ORA-06512: at "XDB". DBMS_XMLSCHEMA', line 61
    ORA-06512: at "XDB". DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 2

    the xml code that I am trying register is
    <? XML version = "1.0" encoding = "ISO-8859-1? >
    <! DOCTYPE metadata SYSTEM "http://www.fgdc.gov/metadata/fgdc-std-001-1998.dtd" >
    < metadata >
    < idinfo >
    < quote >
    < citeinfo >
    < source > FDM < / original >
    < pubdate > 20040512 < / pubdate >
    < pubtime > 09000000 < / pubtime >
    < title > BAS_EASEMENT < / title >
    etc.

    Pls help me for the recording of the xml schema.

    If your DTD is valid...

    .. then the following may help...

    Re: conversion of xmltype, error ORA-31011

    See the last comment on this mentioned by Mark Drake

    --
    -- Turn off DTD Validation
    --
    alter session set events ='31156 trace name context forever, level 2
    / 
    
  • Access to the XML schemas from the connection manager?

    The connection manager for a connection opened in version 4 is no longer an 'XML Schémas' icon (Java and XML patterns seem to have been deleted between versions 3 and 4). Is there a definition that can return the XML schemas?

    Using lists yet... »

    XML schemas

    XML schemas are definitions of schema, written in XML, that describe the structure and various other semantics of XML instance documents. For conceptual and information on the use of XML schemas, see the Guide of Oracle XML DB Developer in the Oracle database documentation library.

    You can change an XML schema by right clicking in the connections Navigator XML schema name and selecting open from the menu. You can delete a selected schema by selecting the Drop Schema menu. » ...

    The XML node drawings missing in the connections Navigator is a known issue for the 4.0.1.  The 4.0.2 patch is a fix.

    Regarding the Java node, it seems to me in all versions 4.0.x.  Maybe your Preferences... > Database > Navigation filter turned it off?

    Kind regards
    Gary

    SQL development team

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

  • How to create the default column in XML schema?

    Hi all

    I would like to define a default column Let's say Run_Date as Date data type in XML (XSD) schema definition and would fill column Run_Date SYSDATE, when XML documents are parsed to this schema.
    Let me know, how can we achieve?

    Thanks in advance.

    Also, I can not change the contents of the XML file, because it is generated by another language, but I can change the definition of XML schema, if necessary.

    Well, if you can not change the XML instance, you cannot change the schema, it conforms to the.
    You can add an optional attribute whose value by default, but we can only use a static value.

    How do you insert the file into the table?

  • If you programmatically, via an INSERT statement, then I think your best bet is to create a new table with a relational schema XMLType column and a DATE column:

    CREATE TABLE employees (
      dt_created date default sysdate not null
    , xmldoc     xmltype
    , CONSTRAINT emp_pk PRIMARY KEY (xmldoc."XMLDATA".EMP_NO)
    )
    XMLTYPE COLUMN xmldoc STORE AS OBJECT RELATIONAL
    XMLSCHEMA "EMP.xsd" ELEMENT "Emp" ;
    

    If you choose to do so, remove the XML schema and enter it again with "genTables-online false."

  • If you have inserted the file via the XDB (FTP, WebDAV, createResource) repository and relying on the table by default feature, then you may be out of luck.
    There is probably a way to tamper with the underlying structure of GOLD among a hidden column do accept a default value, but since it is not supported I won't even try.

  • XML schema to generate data from the table of data from a repeating subform

    Hi all, I would like to have a check box that when checked, allows you to hide a quote form and make a purchase order form visible, carrying a part of the field of the form of citation data in a new table on the order form. I have attached to this form to https://workspaces.acrobat.com/?d=pqpsXx5VPi * LkMeVKrX57w if you want to take a look. If the check box is cleared, he hid the PO form and to make quite visible.

    The idea behind this is that my client will create his quote and send t to his client. Once the customer accepts the quote, he simply click a button to generate its purchase order send it to its supplier.

    It seems that I have buttons to add lines on the submission form that the problem is more complex. I would be able to do it myself if the table has a fixed number of lines and I was able to use global fields, and naming each cell something different, but because it's a single repeating subform, I can't operate at all.

    I understand that, because it's a repeating subform that I need to create an XML schema to do this, but also can not know for the life of me how to create the schema. I read tons of tutorials, but no idea how to apply it to my specific needs. I've been able to find only info on how to bind the data source once it's been created.

    I would be eternally grateful if someone could help out me.

    Thank you!

    I edited your form and put it here.

    Here's what I did:

    • Script inserted into your box renamed someone who mask/displays the purchase order / sales quotation
    • I have included a script object with a function I wrote to transfer data from as named fields/subforms from one section to another
    • Inserted a few fields in your table of purchase order

    What you need to do is to complete the development of your purchase order table. Make sure that the common fields between the quote and purchase tables have the same name in order to transfer data.

    No necessary schema.

    Kyle

  • Help to download the xml of the oracle table below

    Dear all,

    I tried best to download the below xml to oracle table but giving the link between the tables is very difficult for me. can someone help me to import the XML below for oracle table

    <? XML version = "1.0" encoding = "utf-8"? >
    < Claim.Submission xmlns:tns = "http://www.haad.ae/DataDictionary/CommonTypes" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation = "http://www.haad.ae/DataDictionary/CommonTypes/ClaimSubmission.xsd" >
    < header >
    MF65 < SenderID > < / SenderID >
    C014 < ReceiverID > < / ReceiverID >
    < TransactionDate > 03/12/2012 10:40 < / TransactionDate >
    < RecordCount > 1 < / RecordCount >
    < DispositionFlag > PRODUCTION < / DispositionFlag >
    < / header >
    < claim >
    < ID > 23112 / < ID >
    < MemberID > 100000874 < / MemberID >
    A022 < PayerID > < / PayerID >
    MF65 < ProviderID > < / ProviderID >
    < EmiratesIDNumber > 111-1111-1111111-1 < / EmiratesIDNumber >
    < raw > 115 < / gross >
    < PatientShare > 20 < / PatientShare >
    < net > 95 < / Net >
    < meeting >
    MF65 < FacilityID > < / FacilityID >
    < type > 1 < / Type >
    < > 47685 PatientID < / PatientID >
    < Start > 02/11/2012 12:00 < / Start >
    < / meeting >
    < Diagnostics >
    Principal of < type > < / Type >
    < code > < code > 461.9
    < / Diagnosis >
    < Diagnostics >
    Secondary < type > < / Type >
    < code > < code > 462
    < / Diagnosis >
    < activity >
    23112_1 < ID > < /ID >
    < Start > 02/11/2012 12:00 < / Start >
    < type > 3 < / Type >
    < code > < code > 99202
    < quantity > 1 < / quantity >
    < net > 95 < / Net >
    D1310 < clinician > < / clinician >
    < / activity >
    < / claim >
    < Claim.Submission >

    Pls tell me how I can get

    Have you considered using the storage relational object for this?
    Since you have patterns, you could record in the database, which will automatically create storage appropriate for your XML documents as well as validate at the time of insertion.
    You can then create individual views to query the nested parts of the document and finally insert the data into relational tables final.

    See the documentation for an introduction to the concepts:
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/partpg2.htm#g997354

    You will find examples on the {forum: id = 34} forum and its FAQ: {: identifier of the thread = 410714}

Maybe you are looking for