Loading XMF file using Sqlloader In Oracle table

How do load an XML file that is in the following format?
<WorkPermit>TEST01</WorkPermit>
<WellSerialNum>123456</WellSerialNum>
<Depth>1000.00</Depth>

Use Sql*Loader. It is native and will be faster than anything you can write yourself. If for some reason the machine cannot have that installed, use a StringTokenizer (or String#split()) and then use JDBC bulk inserts.
- Saish

Similar Messages

  • How to Load file name in to Oracle table column

    hi,
    I am loading data from flat file(TEST_GRET.DMP) to oracle table.
    while the Target Oracle table has four coloumns, in which one is File_name.
    I want to load the FILE NAME into that table too. as there is no ????
    how it can be done???
    Regards,

    If you are loading multiple files using a single interface, using variables, Bhabani's first solution and my solution are good.
    If you only have one interface with your datastore, you know the file name and it won't change, you can use Bhabani's second solution or mine.
    I did not test my solution but it is quite simple to test.
    Just put the code provided for the mapping of your target column.
    This solution has the advantage it should always work.
    Regards

  • How load File as Blob in Oracle Table?

    Hi, I am beginner in ODI.
    How load File as BLOB in Oracle Table?

    Ah so nice, a FAQ, by someone who can't use online resources!
    Any explanation why Google is broken for you?
    Here is the code I use to load a jpg.
    procedure upd_portrait(p_person_id in number, p_file_name in varchar2) is
    l_blob blob;
    l_bfile bfile;
    begin
    update person
    set portrait = empty_blob()
    where id = p_person_id
    returning portrait into l_blob;
    l_bfile := bfilename('MY_IMAGES', p_file_name);
    dbms_lob.fileopen(l_bfile);
    dbms_lob.loadfromfile(l_blob, l_bfile, dbms_lob.getlength(l_bfile));
    dbms_lob.fileclose(l_bfile);
    end;
    Sybrand Bakker
    Senior Oracle DBA

  • Load multiple files using the same data load location

    has anybody tried loading multiple files using the same load locations. I need to do this as the data in these multiple files will need to be exported from FDM as a single export file. the problem i am facing is more user related. since these files will be received at different points of time, users will need a way to tell them what has been loaded and what is yet to be loaded.
    is it possible to throw a window on the web broser with OK and Cancel buttons from an event script?
    any pointers to possible solutions will be helpful

    was able to resolve this. the implementation method is as follows
    take a back up of previously imported data in the befcleardata event script. then in the beffileimport event append the data to the import file. there are many other intricacies but this is the broad implementation logic. it allowed my users to load multiple files without worrying about append or replace import type choices

  • I am  unable to load GRAPHIC files using the transaction SFP.

    I am  unable to load GRAPHIC files using the transaction SFP.
    The error message says that there is no connection to the below given url.
       http://<hostname:8000>/sap/bc/fp/
    is it something like i have to activate this service in transaction sicf ?

    Try http://<hostname:8000>/sap/bc/fp/!
    ! at the end ..
    Regards
    Juan

  • Can I load gMax files using Java3D?

    Can I load gMax files using Java3D?
    I need to know this if I am going to use Java for my project.

    What format are the files in? Can you export as .3ds? If you can, there are loaders for these files.
    There are also loaders available for VRML, Obj, etc - see what you can export the file as.

  • Loading accdb file using for each loop in to single target table

    I have 3 accdb file as below in single folder, in control flow I have created a for each loop to loop through all the below file.  In dataflow task I have created oledb source using connection manager to point to first file a1.accdb. I am trying
    to load all the file into single below mentioned target table, here It is only loading first file it is not looping through other two file.
    This I have tried to load .txt files and csv files it is working perfectly but similarly when I try to load access db file table it is not working, can any one of you help me?
    1. a1.accdb contains only one table  a1tab ( col1 col2 col3 )  
    2. a2.accdb  contains only one table  a2tab  ( col1 col2 col3 )
    3. a3.accdb  contains only one table  a3tab   ( col1 col2 col3 )
    I have a target table with similar structure as source
    Target table <TargetTable> Col1 Col2 Col3
    aak

    Thanks Arthur, please find below response
    How do you handle the different table names?  Cant we handle it in a similar manner, how we handle the .csv/.txt files with different name and similar structure for sources(multiple files) and target (single table)
    Is it good to drop the idea of for each loop and create a separate task for each accdb file? to be loaded to same target table( performance wise etc.. any justification would be helpful)
    You must handle the connection string dynamically?
    Can you help me with the logic for handling connection string dynamically
    aak

  • Upload excel sheet data through sqlloader into oracle tables

    hi everyone,
    i am working with excel sheet with following records
    8501      Jacob Marshall      15000      21/10/2009      Finance
    8502      Chris Campell      50000      13/06/2008      R&D
    8503      Simon Dough      50000      3/07/2008      Engineering
    8504      Mark Haggai      75000      9/3/2006      Product Management
    8505      Verica Beverley      45000      7/2/2008      HR
    and i saved it in emp_details.csv
    after that when i write following code to make control file
    load data
    infile 'C:\Documents and Settings\prashant_dabral\Desktop\a.txt'
    into table tmp
    field terminated by','optionally enclosed by" "
    (emp_no,emp_name,salary,doj,dept_name)
    after this pl\sqldev returning me error message that ORA-00900:invalid sql statement
    can anybody tell me how to resolve issue
    or
    another method to Upload excel sheet data through sqlloader into oracle tables

    A control file is a file located on the operating system, not some SQL or PL/SQL code you try and execute.
    Create the control file as a file and then use that to load your data with SQL*Loader from the command line.
    http://www.morganslibrary.org/reference/sqlloader.html
    Or better still, create it as an external table and then you don't need a seperate control file or need to use sql loader from the command line...
    http://www.morganslibrary.org/reference/externaltab.html

  • Getting ORA-22805 when trying to load XML file using SQLLDR

    I'm trying to learn the basics of XML since we'll be getting XML files in the near future. I'm using one of the sample schemas that comes with XMLSPY. I loaded this schema into an 11g Oracle DB using XMLSPY:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XML Spy v4.0 NT beta 1 build Jun 13 2001 (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ipo="http://www.altova.com/IPO" targetNamespace="http://www.altova.com/IPO" elementFormDefault="unqualified" attributeFormDefault="unqualified">
         <annotation>
              <documentation>
    International Purchase order schema for Example.com
    Copyright 2000 Example.com. All rights reserved.
    </documentation>
         </annotation>
         <!-- include address constructs -->
         <include schemaLocation="address.xsd"/>
         <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
         <element name="comment" type="string"/>
         <complexType name="PurchaseOrderType">
              <sequence>
                   <element name="shipTo" type="ipo:Address"/>
                   <element name="billTo" type="ipo:Address"/>
                   <element ref="ipo:comment" minOccurs="0"/>
                   <element name="Items" type="ipo:Items"/>
              </sequence>
              <attribute name="orderDate" type="date"/>
         </complexType>
         <complexType name="Items">
              <sequence>
                   <element name="item" minOccurs="0" maxOccurs="unbounded">
                        <complexType>
                             <sequence>
                                  <element name="productName" type="string"/>
                                  <element name="quantity">
                                       <simpleType>
                                            <restriction base="positiveInteger">
                                                 <maxExclusive value="100"/>
                                            </restriction>
                                       </simpleType>
                                  </element>
                                  <element name="price" type="decimal"/>
                                  <element ref="ipo:comment" minOccurs="0"/>
                                  <element name="shipDate" type="date" minOccurs="0"/>
                             </sequence>
                             <attribute name="partNum" type="ipo:Sku"/>
                        </complexType>
                   </element>
              </sequence>
         </complexType>
         <simpleType name="Sku">
              <restriction base="string">
                   <pattern value="\d{3}-[A-Z]{2}"/>
              </restriction>
         </simpleType>
    </schema>
    Then I created an XMLType table:
    CREATE TABLE purchaseOrder OF XMLType
    XMLSCHEMA "ipo.xsd" ELEMENT "purchaseOrder"
    I'm trying to load the sample XML file ipo.xml into purchaseOrder using SQLLDR. This is ipo.xml:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Mr. Nobody (Altova GmbH) -->
    <ipo:purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ipo="http://www.altova.com/IPO" orderDate="1999-12-01" xsi:schemaLocation="http://www.altova.com/IPO
    ipo.xsd">
         <shipTo export-code="1" xsi:type="ipo:EU-Address">
              <ipo:name>Helen Zoe</ipo:name>
              <ipo:street>47 Eden Street</ipo:street>
              <ipo:city>Cambridge</ipo:city>
              <ipo:postcode>126</ipo:postcode>
         </shipTo>
         <billTo xsi:type="ipo:US-Address">
              <ipo:name>Robert Smith</ipo:name>
              <ipo:street>8 Oak Avenue</ipo:street>
              <ipo:city>Old Town</ipo:city>
              <ipo:state>AK</ipo:state>
              <ipo:zip>95819</ipo:zip>
         </billTo>
         <Items>
              <item partNum="833-AA">
                   <productName>Lapis necklace</productName>
                   <quantity>2</quantity>
                   <price>99.95</price>
                   <ipo:comment>Need this for the holidays!</ipo:comment>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="748-OT">
                   <productName>Diamond heart</productName>
                   <quantity>1</quantity>
                   <price>248.90</price>
                   <ipo:comment>Valentine's day packaging.</ipo:comment>
                   <shipDate>2000-02-14</shipDate>
              </item>
              <item partNum="783-KL">
                   <productName>Uncut diamond</productName>
                   <quantity>7</quantity>
                   <price>79.90</price>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="238-KK">
                   <productName>Amber ring</productName>
                   <quantity>3</quantity>
                   <price>89.90</price>
                   <ipo:comment>With no inclusions, please.</ipo:comment>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="229-OB">
                   <productName>Pearl necklace</productName>
                   <quantity>1</quantity>
                   <price>4879.00</price>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="128-UL">
                   <productName>Jade earring</productName>
                   <quantity>5</quantity>
                   <price>179.90</price>
                   <shipDate>2000-02-14</shipDate>
              </item>
         </Items>
    </ipo:purchaseOrder>
    This is what's in the control file:
    LOAD DATA
    INFILE *
    INTO TABLE purchaseOrder TRUNCATE
    xmltype(xmldata)
    FIELDS
    xmldata LOBFILE (CONSTANT ipo.xml)
    BEGINDATA
    0
    The load fails with:
    Record 1: Rejected - Error on table PURCHASEORDER.
    ORA-22805: cannot insert NULL object into object tables or nested tables
    Another question I have is, how do we know how many records (0's) to specify in the control file? In this case there's only one but when real files are used we won't know how many are in the file.
    Thanks for your help!

    The concept was "Don't use SQL*Loader to parse XML".
    You can use SQL*Loader to load an entire XML document into the DB. That is fine. You can do the same via BFILENAME to read in files from disk as well.
    If you want to parse XML, do that from within Oracle via PL/SQL and/or SQL. The solution depends upon your version of Oracle and what is good enough for you in terms of performance.
    So the basics are
    a) How am I getting the information?
    b) How am I getting in into Oracle?
    c) How do I want to parse it?
    As I see the schema, it only allows for one ipo:purchaseOrder node in the document, since that is the root node. If you have multiple in the incoming file, you no longer have valid XML, both per the schema and because you have no single root node. You have an XML fragment, which must be treated different.
    Just trying to understand the question since I now realize it does not agree with what the schema in your initial example shows.

  • Error while loading xml files using JDBC

    Hi,
    I am trying to load xml files into an xmltype table using JDBC calls and am getting this error for some files
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    The xml files and our database are both UTF-8 encoded. The version of oracle that we have here is 9.2.0.6
    Any suggestions in this matter will be greatly appreciated.
    Thanks,
    Uma

    I also experienced this problem and unfortunately this solution didn't work for me given that the tag you suggested was already on the XML file.

  • Loading xml file using owb

    Hi Gurus,
    I am new to owb and as per requirement we need to load xml files into oracle table using owb.
    below is the xml file:
    <bookstore>
    <book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book category="CHILDREN">
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    <book category="WEB">
    <title lang="en">Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
    </book>
    </bookstore>
    please help me in loading above xml file using owb.

    You can leverage the XML SQL functions to extract from XML using the database, see the blog post below;
    https://blogs.oracle.com/warehousebuilder/entry/leveraging_xdb
    For example to extract information from your XML document the following SQL can be generated from OWB;
    select extractValue(value(s), '/book/author'),
    extractValue(value(s), '/book/year'),
    extractValue(value(s), '/book/price') from
    ( select XMLType('<bookstore>
    +<book category="COOKING">+
    +<title lang="en">Everyday Italian</title>+
    +<author>Giada De Laurentiis</author>+
    +<year>2005</year>+
    +<price>30.00</price>+
    +</book>+
    +<book category="CHILDREN">+
    +<title lang="en">Harry Potter</title>+
    +<author>J K. Rowling</author>+
    +<year>2005</year>+
    +<price>29.99</price>+
    +</book>+
    +<book category="WEB">+
    +<title lang="en">Learning XML</title>+
    +<author>Erik T. Ray</author>+
    +<year>2003</year>+
    +<price>39.95</price>+
    +</book>+
    +</bookstore>') adoc from dual+) r,
    table(XMLSequence(extract(r.adoc, '/bookstore/book'))) s;
    Cheers
    David

  • How do i load data in excel to an oracle table

    How do i load data from an excel file with several worksheets into an oracle table?
    using Oracle 10g
    Excel
    sample data of excel
    Name eric Name mary
    AccountNo 123 AccountNo 321
    amount1 5.0 Amount1 1.0
    amount2 5.5 Amount2 2.0
    amount3 6.0 Amount3 3.0
    Total 16.5 Total 6.0
    Name larry Name beth
    AccountNo 123 AccountNo 321
    amount1 5.0 Amount1 1.0
    amount2 5.5 Amount2 2.0
    amount3 6.0 Amount3 3.0
    Total 16.5 Total 6.0
    Note: Assume data are aligned into columns like a real excel workbook

    Hi,
    You can make one csv file per sheet. After what you can use sql*loader utyility.
    Since 9i, there is external table : http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_7002.htm#i2129649
    Nicolas.

  • SQL loaded not loading data from csv format to oracle table.

    Hi,
    I trying to load data from flat files to oracle table,it not loading decimal values.Only character type of data is loaded and number format is null.
    CONTROL FILE:
    LOAD DATA
    INFILE cost.csv
    BADFILE consolidate.bad
    DISCARDFILE Sybase_inventory.dis
    INSERT
    INTO TABLE FIT_UNIX_NT_SERVER_COSTS
    FIELDS TERMINATED BY ',' optionally enclosed by '"'
    TRAILING NULLCOLS
    HOST_NM,
    SERVICE_9071_DOLLAR FLOAT,
    SERVICE_9310_DOLLAR FLOAT,
    SERVICE_9700_DOLLAR FLOAT,
    SERVICE_9701_DOLLAR FLOAT,
    SERVICE_9710_DOLLAR FLOAT,
    SERVICE_9711_DOLLAR FLOAT,
    SERVICE_9712_DOLLAR FLOAT,
    SERVICE_9713_DOLLAR FLOAT,
    SERVICE_9720_DOLLAR FLOAT,
    SERVICE_9721_DOLLAR FLOAT,
    SERVICE_9730_DOLLAR FLOAT,
    SERVICE_9731_DOLLAR FLOAT,
    SERVICE_9750_DOLLAR FLOAT,
    SERVICE_9751_DOLLAR FLOAT,
    GRAND_TOTAL FLOAT
    In table FLOAT are replaced by number(20,20)
    SAmple i/p from csv:
    ABOS12,122.46,,1315.00,,1400.00,,,,,,,,1855.62,,4693.07
    Only abos12 is loaded and rest of the number are not loaded.
    Thanks.

    Hi,
    Thanks for your reply.
    Its throwing error.
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table FIT_UNIX_NT_SERVER_COSTS, loaded from every logical record.
    Insert option in effect for this table: INSERT
    TRAILING NULLCOLS option in effect
    Column Name Position Len Term Encl Datatype
    HOST_NM FIRST 255 , O(") CHARACTER
    SERVICE_9071_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9310_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9700_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9701_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9710_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9711_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9712_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9713_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9720_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9721_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9730_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9731_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9750_DOLLAR NEXT 255 , O(") CHARACTER
    SERVICE_9751_DOLLAR NEXT 255 , O(") CHARACTER
    GRAND_TOTAL NEXT 255 , O(") CHARACTER
    value used for ROWS parameter changed from 64 to 62
    Record 1: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 2: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 3: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 4: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 5: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 6: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 7: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 8: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 9: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 10: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Record 11: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column GRAND_TOTAL.
    ORA-01722: invalid number
    Please help me on it.
    Thanks,

  • SQL Loader Control File Recoverable Option in Oracle 9i

    We are migrating from Oracle 8 to Oracle 9i. We are running some of the SQL*Loader scripts. The control file uses "OPTIONS (UNRECOVERABLE)" option, which is working fine with Orace 8 whereas it is not working in
    Oracle 9i. Are these options "RECOVERABLE/UNRECOVERABLE" removed from Oracle 9i. If yes, why ? Or do we have an alternate option for the same.
    Thanks in advance.
    Balaji

    974647 wrote:
    my requirement is that for the remaining 2 columns, i want to insert text 'COLUMN_DROPPED' in backend table.Rest 8 columns should be populated as usual.First of all it is only possible if remaining 2 column datatype is string (char/nchar, varchar2/nvarchar2, clob/nclob) and are at least 14 characters. The rest is easy. Just modify last 2 fields in control file:
    column9  constant 'COLUMN_DROPPED',
    column10 constant 'COLUMN_DROPPED'SY.

  • Loading XML files using TCP/IP

    Hi.
    My PL/SQL procedure loading xml files from oracle logical directory ("c:\temp") and inserting values into columns of the table. I use XSU with procedure:
    create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    begin
    insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    end;
    For translate xml document to CLOB, I use :
    CREATE OR REPLACE function getdocument(
    p_directory in varchar2,
    p_filename in varchar2)
    return clob
    is
    l_bfile bfile;
    l_clob clob;
    begin
    l_bfile := bfilename(p_directory, p_filename);
    dbms_lob.open(l_bfile);
    dbms_lob.createtemporary(l_clob, true, dbms_lob.session);
    dbms_lob.loadfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile));
    dbms_lob.close(l_bfile);
    return l_clob;
    end getdocument;
    I didn't have problem with this procedures. But now i want load my xml files from another computer (i want use TCP/IP, not oracle logical directory). Is it within the realm of possibility?
    How can i do it, using standart PL/SQL methods?
    P.S. Sorry my English.

    The UTL_TCP package should give you exactly what you want. See
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_tcp.htm

Maybe you are looking for

  • "Cannot buy because your account is disabled"

    I keep getting this error even though my account is fine on reg itunes. Any else experiencing this on their iphone when trying to buy an app?? thanks

  • ColdFusion AIR Synchronization - Best practices

    I'm a long time ColdFusion developer who has put off learning Flex because I never had a need (not to mention the bad taste Flash left in my mouth in its early stages).  Now I'm jumping in because of its integration with Air+SQLite and Coldfusion9 th

  • Searching within clob columns

    I have two tables client_captions (which contains a varchar2 column called captions) clients (which contains a clob column called client) I'd like to know how many clients have any of the client captions within their clients data (which is a clob col

  • Really need help... How to print the 'content' of a JTextArea?

    Hello, i'm currently developping a HTML Editor in java but i've got a problem with printing job... Does anyone know a simple code to print the content of a textarea by clicking on a button? for instance: JTextarea textarea = new JTextArea(); JButton

  • Need Help!  I lost entire itunes library after copying "My Music" folder to an external hard drive.

    I was recently hire by one of my sisters friends to set up a new computer and to repair wireless router.  The client asked me to copy music files from their old computer to an external hard drive so that they could be transfered to the new computer.