Load XML data into an Oracle Database

Hi
I would like to know how to load data from XML into an Oracle Database. Thanks

forum has many examples
plz search for your needs
as example
XML DB FAQ
Re: I want insert data from xml file
Re: How to load a XML file into a table using PL/SQL
Process multiple XML files in directory
using DBMS_LOB.LOADCLOBFROMFILE

Similar Messages

  • Loading xml data to a oracle database problem in style sheet

    Hi,
    I Have one small Problem While loading xml data to a oracle database.
    In the XML i have the Columns and Data Like this.
    <Data>
    <TRAN>
    <Type_Trs>A</Type_Trs>
    <T1>2</T1>
    <T2>3</T2>
    </TRAN>
    <TRAN>
    <Type_Trs>B</Type_Trs>
    <T1>2</T1>
    <T2>3</T2>
    </TRAN>
    </Data>
    I have TRAN Table having Field Like this.
    TRAN(Type_Trs,T1,F)
    Note:- The XML Column T2 is Not matching with TRAN Table Column F
    I want to fetch T2 data into F column.
    When I am fetching the xml data into oracle table only
    one row is fetching.
    Can You help me
    To load the the all the record of XML data into the Oracle Table
    What will be my XLS Style Sheet File Please
    suggest me.
    Regards
    MBR
    Thnks in Advance

    Hi MBR
    You would be better posting your question to the general XML forums:
    http://forums.oracle.com/forums/category.jspa?categoryID=51
    This is purely for XML/BI Publisher where we get the data back out of the db :o)
    Tim

  • Best method to load XML data into Oracle

    Hi,
    I have to load XML data into Oracle tables. I tried using different options and have run into a dead end in each of those. I do not have knowledge of java and hence have restricted myself to PL/SQL solutions. I tried the following options.
    1. Using DBMS_XMLSave package : Expects the ROWSET and ROW tags. Connot change format of the incoming XML file (Gives error oracle.xml.sql.OracleXMLSQLException: Start of root element expected).
    2. Using the XMLPARSER and XMLDOM PL/SQL APIs : Works fine for small files. Run into memory problems for large files (Gives error java.lang.OutOfMemoryError). Have tried increasing the JAVA_POOL_SIZE but does not work. I am not sure whether I am changing the correct parameter.
    I have read that the SAX API does not hog memory resources since it does not build the entire DOM tree structure. But the problem is that it does not have a PL/SQL implementation.
    Can anyone PLEASE guide me in the right direction, as to the best way to achieve this through PL/SQL ??? I have not designed the tables so am flexible on using purely relational or object-relational design. Although would prefer to keep a purely relational design. (Had tried used object-relational for 1. and purely relational for 2. above)
    The XML files are in the following format, (EXAMINEEs with single DEMOGRAPHIC and multiple TESTs)
    <?xml version="1.0"?>
    <Root_Element>
    <Examinee>
    <MACode>A</MACode>
    <TestingJID>TN</TestingJID>
    <ExamineeID>100001</ExamineeID>
    <CreateDate>20020221</CreateDate>
    <Demographic>
    <InfoDate>20020221</InfoDate>
    <FirstTime>1</FirstTime>
    <LastName>JANE</LastName>
    <FirstName>DOE</FirstName>
    <MiddleInitial>C</MiddleInitial>
    <LithoNumber>73</LithoNumber>
    <StreetAddress>SomeAddress</StreetAddress>
    <City>SomeCity</City>
    <StateCode>TN</StateCode>
    <ZipCode>37000</ZipCode>
    <PassStatus>1</PassStatus>
    </Demographic>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>1</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>2</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    </Examinee>
    </Root_Element>
    Thanks for the help.

    Please refer to the XSU(XML SQL Utility) or TransX Utility(for Multi-language Document) if you want to load data in XML format into database.
    Both of them require special XML formats, please first refer to the following docs:
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/xsu/xsu_userguide.html
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/transx/readme.html
    You can use XSLT to transform your document to the required format.
    If you document is large, you can use SAX method to insert data into database. But you need to write the code.
    The following sample may be useful:
    http://otn.oracle.com/tech/xml/xdk_sample/xdksample_040602i.html

  • Different ways to download data into a Oracle database

    Apart from the below are there any other ways to download data into an Oracle database ?
    1. Import data using import/export features.
    2. Oracle external tables.
    3. Data Pump
    4. SQL Loader.
    5. PL/SQL => utl_file package.
    6. Oracle SQL developer tool - it was a nice surprise this morning to know that this tool can be used to import data into Oracle database.
    Thanks
    Gony

    I will be able to do that once I complete my transition into an Oracle DBA
    Next Great DBA
    I downloaded oracle to my laptop today.
      I will become the next great DBA.
    No need for education or taking a course,
      I'll use the forum and learn by brute force.
    The guru's won't mind, they know it all
      They are so profound, their ego's enthrall.
    They have it written by steps 1 through 10.
      If I don't get it once, I'll just ask it again.
    I won't write it down, seems simple enough
      After all, I've used Access with SQL and stuff.
    Why you upset? Why you tell me to read?
      I've no time for a manual, No Sir, Indeed!
    Why waste my time with a book or a link,
      I have this forum, no need to think.
    I have no work history, just out of college,
      But I'm smarter than those who are three times my age.
    I'll become certified with an OCP,
      Have you the answers, just give them to me.
    Then we'll be equal just wait and see!
      But, Why are you paid 100K more than me?Edited by: sb92075 on Jul 12, 2009 7:57 AM

  • Option to load XML data into BI 70

    Hi All,
    I have read some postings on forums and also have read the "HOW TO load XML data in BW" guide. I am confused when I read the SAP online help documentation for loading XML data .
    Question : Out of the 3 options listed below which option is best suited for loading XML data into BW . XML file is going to be provided by 3rd party company ?
    Thanks and appreciate any input .
    Smith .
    Here is what I found for BI 70 EHP1 help :
    http://help.sap.com/saphelp_nw04s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
    Data is generally transferred into SAP BW by means of a data request, which is sent from SAP BW to the source system (pull from the scheduler). You can also send the data to SAP BW from outside the system. This is a data push into SAP BW.
    A data push is possible for various scenarios:
    ●     Transferring Data Using the SOAP Service SAP Web AS
    ●     Transferring Data Using Web Services
    ●     Transferring Data Using SAP XI
    In all three scenarios, data transfer takes place using transfer mechanisms that are sufficient for Simple Object Access Protocol (SOAP); the data transfer is also XML-based.
    The SOAP-based transfer of data is only possible for flat structures. You cannot transfer hierarchy data.

    Hi,
    I feel you can go with 2nd option. But still wait for some more inputs from Experts........
    Regards,
    Suman

  • Extract data into the Oracle Database

    Hello,
    I have file in PDF format.
    I need to extract data into the Oracle Database.
    what should be my action ?
    And how could I accomplish?
    thanks
    DN

    You said:
    Do you know ahead of time how many columns are in the file?
    yes, It has 8 columns.
    But each PDF have different total of columns. Right now I am working on one PDF file only.
    e.g: page emp report has following values:
    Salray History Report in PDF format
    Page 1
    Date 10-21-2005
    LAST NAME SALARY COMMISSION
    Russell 14000 .4
    Partners 13500 .3
    Errazuriz 12000 .3
    Cambrault 11000 .3
    Zlotkey 10500 .2
    after converting it will be come as
    Salray History Report in PDF format
    Page 1
    Date 10-21-2005
    LAST NAME
    SALARY
    COMMISSION
    Russell
    Partners
    Errazuriz
    Cambrault
    Zlotkey
    14000
    13500
    12000
    11000
    .4
    .3
    .3
    .3
    End of Page 1
    Date 10-21-2005
    LAST NAME
    SALARY
    COMMISSION
    DN

  • What is the best way to put LabVIEW DSC data into an Oracle database?

    I have been collecting data using LabVIEW DSC 7.0 for several years and have always accessed the data from the Citadel database via the Historical Data Viewer.  I would now like to begin putting this data into an Oracle database.  My company stores all their data in Oracle and it would provide me all the benefits of their existing infrastructure such as automated backups, data mining tools, etc.
    My initial thought is to use "Read Trace.vi" in LabVIEW to pull historical data from the citadel database at regular intervals (e.g. 1 minute) and insert this data into Oracle via ODBC.  In this way, I do not need to track the value changes in order to know when to write to Oracle.  I also considered replicating the citadel database using some other method, but I recall that the tables used by citadel are somewhat complicated.  I only need a simple table with columns for channel, timestamp, and data.  The "Read Trace.vi" will provide me data in this format.
    I do not need to update the Oracle database in real time, a few minute delay is acceptable. If anyone has a better idea or additional insight please let me know. Thanks.

    In terms of connectivity, you want to use ADO, not ODBC. Beyond that, it all depends on the structure of the data and what you are going to want to do with it. This is a very big question that you need to be getting some in-depth assistance.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Load xml data into database

    Hi,
    I need to load the xml data into the relational tables. I was trying to use a DOM parser, but the thing is that i had to hard code the element node values to match the columns in the tables, and in later stage if there is change to the xml i have to change my program and recompile, i want a more flexible solution, where in i can parse the data and load into database without much changes. I do not know how to accomplish this. I have searched on this topic, but could not find a clear solution anywhere. Can anybody suggest a solution to this.
    Thanks & regards.

    For which database?
    With the Oracle database an XML document may be stored in a database with the XML SQL (XSU) utility.
    1. Create a table in the database with columns corresponding to the elements in the XML document.
    2. With the XSU store the XML document. The attributes in the XML document do not get stored.
    3. To store the attributes also, apply an XSLT to the XML document and convert the attributes to elements.

  • Load xml data into oracle table

    Hi,
    How to load the xml data in to oracle table plz guide in this context
    thanks

    Use the DBMS_XMLSAVE.INSERTXML procedure.
    It works fine.

  • Loading XML Data into Relational Table

    Hello,
    I receive an XML file generated from another tool (on Windows), I am trying to create a Linux shell script that will gather the needed XML file from my Linux database server, then have Oracle use this file to load the XML data into a relational table. This activity & data will be needed on an ongoing basis.
    I have tried this two ways. First, I loaded the XML document into the database and tried to extract the data directly from the document, but that is not working. Now I want to try to read the data directly from the file on the server via select, however I am not getting any data returned. In the Select statement below, I am simply trying to query the data to see what is returned for my testing.
    Create Table ci_results_table (transactionID Varchar2(100), //transactionID should be PrimaryKey but was getting NULL value errors during insert test, so removed PK
    message Varchar2(200),
    ci Varchar2(50),
    processeddate xmltype,
    status Varchar2(50),
    sourcefile VarChar2(100));
    select x.*
    from XMLTable(
         'TSPLoadResults/Results'
         PASSING xmltype(bfilename('CMDB_DEVADHOCRESULTS_DIR','LoadResults-HP_146.results.xml'), nls_charset_id('AL32UTF8'))
         COLUMNS
           transactionID Varchar2(100) PATH 'TransactionID',
           Result XMLType PATH 'Result',
           Message Varchar2(200) PATH 'Message',
           PrimaryKey Varchar2(50) PATH 'PrimaryKey',
           ProcessedDate date PATH 'ProcessedDate',
           Status Varchar2(50) PATH 'Status',
           SourceFile VarChar2(100) PATH 'SourceFileName'
       ) x
    Eventually I will need to build on this to limit the data returned to those records where SourceFileName is like 'HPDS%' and insert what is returned in to the ci_results_table. Attached is a sample Results XML file I am trying to load, It is named "ResultsTransformedtoUnix" because I used dos2Unix to convert it to Unix which may be right or wrong. (The output file I send out has to be transformed to DOS format before the other application can read it). Original file (before Unix conversion) named in script is also attached.
    Please help. Thank you!

    Hi,
    I see some wrong things in your query.
    1) The obvious one, explaining why you're not getting any data : there's a typo in the XQuery expression, it's "Result" not "Results"
    2) ProcessedDate cannot be extracted as a date (at least not directly) since it actually represents a timestamp, use TIMESTAMP WITH TIME ZONE datatype and cast back to DATE in the SELECT clause
    3) transactionID is an attribute, it must be accessed with '@' (or 'attribute::' axis)
    4) If the file encoding is truly ISO-8859-1 as the prolog suggests, then do not use AL32UTF8 but the corresponding charset name : WE8ISO8859P1
    Here's the working query :
    select x.transactionID
         , x.Message
         , x.Primarykey
         , cast(x.ProcessedDate as date) ProcessDate
         , x.Status
         , x.SourceFile
    from XMLTable(
           '/TSPLoadResults/Result'
           PASSING xmltype(bfilename('XML_DIR','LoadResults-HP_146.results.xml'), nls_charset_id('WE8ISO8859P1'))
           COLUMNS
             transactionID Varchar2(100)            PATH '@transactionID',
             Message       Varchar2(200)            PATH 'Message',
             PrimaryKey    Varchar2(50)             PATH 'PrimaryKey',
             ProcessedDate timestamp with time zone PATH 'ProcessedDate',
             Status        Varchar2(50)             PATH 'Status',
             SourceFile    VarChar2(100)            PATH 'SourceFileName'
         ) x
    Using this query directly over the file will only perform decently (for large files) on 11.2.0.4 and onwards.
    On prior versions, first load the file in a (temporary) XMLType column with Binary XML storage and SELECT from there.
    because I used dos2Unix to convert it to Unix which may be right or wrong.
    This conversion shouldn't be necessary.

  • Does anyone can help me to import XML string into a ORACLE database

    Hi guys!
    i have some problem that my friend wants me to convert XML string to Oracle relational database which means.
    let's say, there is a table that a row has XML string.
    so table has XML string with varchar type.
    what my friend want me to do is, the string needs to be solved as a relational database.
    like
    A table has 'ID', 'data', 'result' rows
    and Data column has XML string like <?xml version...............>
    then wants to convert that data column's XML data into TABLE B with structure normally XML has.
    i'm so confused and have no idea at all.. also i couldn't find any solution related to my stuff..
    if someone knows how to solve the problem, just let us know
    thx

    The database is 10.2.0
    What sort of example do u want me to give you..
    i thought i give all information on the post..
    i will explain it
    let's say there are 3 columns ID,Name,Code
    Id = normal integer
    Name= varchar
    Code= varchar
    and i need to conver that XML in the Code column into relational databases
    the code column has normal XML code which is starting from <?xml version.... and so on
    so does it explain?
    please help me!

  • Load XML data into MySQL table

    I have numerous XML files, one for each record, with a structure like this (only a small part actually, each file is around 170 KB):
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <speccydata version="1.20.446" formatversion="2.0" languageID="0" time="20130323T222711" localtime="20130323T232711+0100">
        <mainsection title="Summary">
            <section title="Operating System" id="1">
                <entry value="Microsoft Windows 8 Enterprise 64-bit" />
            </section>
            <section title="CPU" id="2">
                <entry title="Intel Core i7 3930K @ 3.20GHz" value="32 °C" />
                <entry title="Sandy Bridge-E 32nm Technology" value="" />
            </section>
            <section title="RAM" id="3">
                <entry value="64,0 GB DDR3 @ 1091MHz (11-11-11-31)" />
            </section>
            <section title="Motherboard" id="4">
                <entry title="ASUSTeK COMPUTER INC. P9X79 WS (LGA2011)" value="25 °C" />
            </section>
            <section title="Graphics" id="5">
                <entry title="SyncMaster (1920x1080@60Hz)" value="" />
                <entry title="SyncMaster (1920x1080@60Hz)" value="" />
                <entry title="24W_LCD_TV (1920x1080@50Hz)" value="" />
                <entry title="Microsoft Basic Render Driver" value="" />
                <entry title="NVIDIA GeForce GTX 680" value="" />
            </section>
            <section title="Hard Drives" id="6">
                <entry title="238GB Corsair Performance Pro (SSD)" value="" />
                <entry title="238GB Corsair Performance Pro (SSD)" value="" />
                <entry title="932GB Seagate ST1000NM0011 (SATA)" value="24 °C" />
                <entry title="16764GB Areca ARC-1882-VOL#000 SCSI Disk Device (RAID)" value="" />
            </section>
            <section title="Optical Drives" id="7">
                <entry title="HL-DT-ST BD-RE BH10LS38" value="" />
                <entry title="HL-DT-ST BD-RE BH10LS38" value="" />
            </section>
            <section title="Audio" id="8">
                <entry title="Realtek High Definition Audio" value="" />
            </section>
        </mainsection>
        <mainsection title="Operating System" id="1">
            <entry>
                <entry title="Model" value="MS Windows 8" />
                <entry title="Edition" value="Enterprise" />
                <entry title="Architecture" value="64-bit" />
                <entry title="Service Pack" value="" />
            </entry>
    I have a table in MySQL, where each record contains the name of the .XML file in a field.
    I need to open the .XML file and load relevant data into a specific field for record 1, then repeat for record 2, until all records are filled with the data from the various .XML files. As an example from the above .XML code, I want to extract the BOLD information and get it into fields called:
    os, cpu, ram, mobo, graphics, hard_drives, etc.
    How to do that?

    Not a trivial task, but one that could be done by writing a script that queries the database to get the XML filename and the record's primary key.
    You can then use SimpleXML to open the XML file, extract the values that you need, and store them in variables. Use the variables and primary key to build a SQL query to update the record with the data you have extracted.

  • Load xml data into table

    Hi all,
    I have an XML file (emp.xml) with below data:
    - <root>
    - <row>
    <lastname>steve</lastname>
    <Age>30</Age>
    </row>
    - <row>
    <lastname>Paul</lastname>
    <Age>26</Age>
    </row>
    </root>
    I'd like to create a stored procedure to store the xml data into EMP table.
    EMP
    LastName Age
    Steve 30
    Paul 26
    I tried to look all the related threads in this forum, but couldn't find the right thread. Any help is greatly appreciated. Thanks

    With
    SQL>  select * from xmltable('root/row' passing xmltype('<root>
    <row>
    <lastname>steve</lastname>
    <Age>30</Age>
    </row>
    <row>
    <lastname>Paul</lastname>
    <Age>26</Age>
    </row>
    </root>') columns lastname path 'lastname',
                       Age path 'Age')
    LASTNAME   AGE      
    steve      30       
    Paul       26   you can now simple do a
    insert into emp as select ....

  • Flex 4 - is it possible to load xml data into the preloader and pass it to the application?

    or is there a similar method to load XML data while the preloader is active, so the XML data will be ready when the main application loads?

    i'm having great difficulty finding any relevant info from the forum and the web about accessing preloader variables from the application.
    is there a way to access the preloader itself from the application?
    It seems logical that the systemManager garbage collects it. If that's the case, how can i access the systemManager from the preloader and possible pass variables to it, then later access them from the application? this seems to be the best direction to tackle this problem. but maybe i'm overlooking another way?

  • Helped, how to load xml data into database

    Hi,
    Given a DTD, can the XML SQL Utility generate
    the database schema?
    I currently have the dtd file to define
    the data type and xml data and I am looking
    for ways of how the XML/DTD can be loaded
    into the oracle db.
    Any suggestions/recommendations are
    appreciated.
    Thanks,
    Judy
    null

    You could check out this web site:
    http://www.rpbourret.com/xml/XMLAndDatabases.htm#software
    where you can find a list of products that can translate a DTD to a relational schema. Also, there are several technical papers that discuss algorithms to carry out this translation. FYI, We have implemented a similar system,and testing it out.
    null

Maybe you are looking for

  • How to install Reader 4.0 on VIsta 64-bit machine

    I have an old program that looks for Acrobat Reader 4.0 under the Adobe programs directory in programs folder. Anyone have any suggestions to install REader 4.0 so my program finds it? Thanks. AR40ENG.EXE was bundled on the installation disk I receiv

  • How to remove the borders of JTabbedPane

    hi, when we create a tabbedpane, we get dark barders. i am usign the system look and feel . is there some way to make the borders flat that means the tabbed pane shuld bot be seen raised but flat.. cheers deepak saini

  • Can only hear 1 audio track?

    I,m new to Elements 10 and have just started editing. I just dragged a clip onto my timeline but can only hear one audio channel. I know there are two tracks, how can I mix both through? thanks.  Darrell

  • Problems generating a cert for ACS 4.1 using MS 2008 R2 Cert Svcs

    I am having difficulty installing a certicate on ACS that was generated using Microsoft Certificate services under Server 2008 R2.  The problem I'm having is finding documentation that addresses using ACS 4.1 and Microsoft Cert Svcs 2008 R2.  There i

  • Result: PRVF-4007 : User equivalence check failed for user "oracle"

    Hi I get below error everytime I run ./cluvfy stage -pre crsinst -n node01,node02 -fixup -verbose > a.log Checking user equivalence... Check: User equivalence for user "oracle" Node Name Comment node02 passed node01 failed Result: PRVF-4007 : User eq