How to read data from flatfile and insert into other relevant tables ? Please suggest me the query ?

Hi to all,
I have flat files in different location through FTP i need to fetch those files and load in the relavant table of the database.
Please share me the query to do it ..

You would need a ForEach Loop to iterate though the files. Initially the FTP task will pull the files from locations to a landing folder. Once thats done the ForEachLoop will iterate through files in the folder and will have a data flow task inside to transfer
file data to tables.
If you want a more secure option you can also use SFTP (Secured FTP) and can implement it using free WinSCP clinet. I've explained a method of doing it fo dynamic files here
http://visakhm.blogspot.in/2012/12/implementing-dynamic-secure-ftp-process.html
for iterating through files see this example
http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
you may not need the validation step inside the loop in your case
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • Problem with reading data from screen and inserting in table

    hi ther,
    im new to abap-webdyn pro. can anyone suggest how to read data from screen and insert into table when press 'ADD' button.
    i done screen gui , table creation but problems with action. what the content of acton add.
    is ther any link that helps me or tut??
    thankx in advance!
    regards

    Hi,
    Create a context node for the screen fields for which you want to enter the values with cardinality 1.1.....
    Now in the layout of your view bind the screen input fields to that context node(attributes) to the value property of the input fields...
    Now in the action of ADD button....
    --> go the wizard and select the read node button and select the node which you have created it generates the auto code for you.....
    for example if the node is contains aone attribute like MATNR
    reading the node from wizard will generate the code as....
    DATA lo_nd_matnr TYPE REF TO if_wd_context_node.
      DATA lo_el_matnr TYPE REF TO if_wd_context_element.
      DATA ls_matnr TYPE wd_this->element_matnr.
      DATA lv_matnr TYPE wd_this->element_matnr-matnr.
    * navigate from <CONTEXT> to <MATNR> via lead selection
      lo_nd_matnr = wd_context->get_child_node( name = wd_this->wdctx_matnr ).
    * @TODO handle non existant child
    * IF lo_nd_matnr IS INITIAL.
    * ENDIF.
    * get element via lead selection
      lo_el_matnr = lo_nd_matnr->get_element( ).
    * @TODO handle not set lead selection
      IF lo_el_matnr IS INITIAL.
      ENDIF.
    * get single attribute
      lo_el_matnr->get_attribute(
        EXPORTING
          name =  `MATNR`
        IMPORTING
          value = lv_matnr ).
    here the variable lv_matnr will contain the entered value......
    now you can use this value for further process.
    Thanks,
    Shailaja Ainala.

  • Read data from Excel and write into oracle database

    Hi
    I want  to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
    Thanks and Regards
    Neeta

    Hai,
    I am suggesting the solution.
    I will try out and let u know soon.
    Make a coma separated file from your excel file.
    Assuming that your requirement allows to make a csv file.
    This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
    You do not want to  go via sql Loader?
    For reading the excel file itself do you want java?

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • How to fetch data from XML and store it in internal table

    Hi All,
    Can anyone help me out, in fetching data from xml and store it in an internal table. Is there any standard function module is there?
    Regards,
    Karthick

    to do this you can either develop a XSLT program and use it with CALL TRNSFORMATION key word to tranform the XML into itab .
    (search the ABAP General forum, i have posted few samples)
    or simply use the following FM which converts your XML into a itab of name value pair (name would holw the element name and value would hold the value of the element) which you can then loop and read it to your itb.
    data:             xmldata type xstring .
    data: result_xml type standard table of smum_xmltb .
    data: return type standard table of bapiret2 .
    CALL FUNCTION 'SMUM_XML_PARSE'
      EXPORTING
        xml_input       = xmldata
      TABLES
        xml_table       = result_xml
        return          = return .
    Regards
    Raja

  • How to extract data from CLOB and insert them into DB?

    Hi PL/SQL Gurus,
    I have no experience in PL/SQL, but I have a requirement now where I have to use it.
    We have a table with 10 columns, one of them is a CLOB and it holds XML data. The XMLs are very huge in size.
    Two new columns are added to the table and the data has to be filled for the existing records from the corresponding XML. The XML has all the data as attributes. I started searching on the internet and tried if I could extract the data out of XML.
    SELECT extractValue(value(x), '/Order/Package/@Code',
    'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"' )
    FROM ORDER_TABLE A
    , TABLE(
    XMLSequence(
    extract(
    xmltype(A.XML_DATA)
    , '/ns0:Root'
    , 'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"'
    ) x;
    But this isn't working. Could anyone please provide some ideas.
    I just want to confirm that I am able to extract data. Once this is done I would like to create a procedure so that all the existing records can be updated.
    Thanks in advance.
    Regards,
    Fazzy

    Can this be acheived using a SQL statement.Yes, you can do it with the DML error logging clause.
    Here's a quick example I've just set up :
    Base table
    SQL> create table order_table (
      2   order_id number,
      3   package_code varchar2(30),
      4   package_desc varchar2(100),
      5   xml_data clob
      6  );
    Table created
    SQL> alter table order_table add constraint order_table_pk primary key (order_id);
    Table altered
    Adding data...
    SQL> insert into order_table (order_id, xml_data)
      2  values (1, '<?xml version="1.0" encoding="UTF-8"?>
      3  <ns0:Root xmlns:ns0="http://mycompany.com/Order/OrderType.xsd" BookingDate="2009-06-07">
      4  <ns1:OrderKey xmlns:ns1="http://mycompany.com/Order/OrderKeyTypes.xsd" SystemCode="THOMAS" Id="458402-TM1" Version="1"/>
      5  <ns0:Package Code="0001" Desc="ProductName1"/>
      6  <ns0:PromotionGroup Code="DSP" Name="OrderThomasPortal"/>
      7  <ns0:Promotion Code="TH902" Name="OrderThomasPortal" SellingName="OrderThomasPortal" BackOfficeName="OrderThomasPortal"/>
      8  <ns0:FinancialSupplier Code="HHT" Name="NYOrdSupp"/>
      9  <ns0:SellingCurrency Code="EUR" Name="Euro"/>
    10  <ns0:Owner ClientId="02654144" ClientMandator="T" ClientSystem="ROSY"/>
    11  <ns0:Agent PersonInAgency="5254" AgentCode="000009" CommissionAmount="2.8" CommissionDueDate="2009-07-01+02:00" VatOnCommission="0"/>
    12  </ns0:Root>');
    1 row inserted
    SQL> insert into order_table (order_id, xml_data)
      2  values (2, '<?xml version="1.0" encoding="UTF-8"?>
      3  <ns0:Root xmlns:ns0="http://mycompany.com/Order/OrderType.xsd" BookingDate="2009-06-07">
      4  <ns1:OrderKey xmlns:ns1="http://mycompany.com/Order/OrderKeyTypes.xsd" SystemCode="THOMAS" Id="458402-TM1" Version="1"/>
      5  <ns0:Package Code="0002" Desc="ProductName2/>
      6  <ns0:PromotionGroup Code="DSP" Name="OrderThomasPortal"/>
      7  <ns0:Promotion Code="TH902" Name="OrderThomasPortal" SellingName="OrderThomasPortal" BackOfficeName="OrderThomasPortal"/>
      8  <ns0:FinancialSupplier Code="HHT" Name="NYOrdSupp"/>
      9  <ns0:SellingCurrency Code="EUR" Name="Euro"/>
    10  <ns0:Owner ClientId="02654144" ClientMandator="T" ClientSystem="ROSY"/>
    11  <ns0:Agent PersonInAgency="5254" AgentCode="000009" CommissionAmount="2.8" CommissionDueDate="2009-07-01+02:00" VatOnCommission="0"/>
    12  </ns0:Root>');
    1 row inserted
    SQL> commit;
    Commit complete
    {code}
    Note that the second row inserted contains a not well-formed XML (no closing quote for the /Root/Package/@Desc attribute).
    *Creating the error logging table...*
    {code}
    SQL> create table error_log_table (
      2   ora_err_number$ number,
      3   ora_err_mesg$   varchar2(2000),
      4   ora_err_rowid$  rowid,
      5   ora_err_optyp$  varchar2(2),
      6   ora_err_tag$    varchar2(2000)
      7  );
    Table created
    {code}
    *Updating...*
    {code}
    SQL> update (
      2    select extractvalue(doc, '/ns0:Root/ns0:Package/@Code', 'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"') as new_package_code
      3         , extractvalue(doc, '/ns0:Root/ns0:Package/@Desc', 'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"') as new_package_desc
      4         , package_code
      5         , package_desc
      6    from (
      7      select package_code
      8           , package_desc
      9           , xmltype(xml_data) doc
    10      from order_table t
    11    )
    12  )
    13  set package_code = new_package_code
    14    , package_desc = new_package_desc
    15  log errors into error_log_table ('My update process')
    16  reject limit unlimited
    17  ;
    1 row updated
    SQL> select order_id, package_code, package_desc from order_table;
      ORDER_ID PACKAGE_CODE                   PACKAGE_DESC
             1 0001                           ProductName1
             2                               
    {code}
    One row has been updated as expected, the other has been rejected and logged into the error table :
    {code}
    SQL> select * from error_log_table;
    ORA_ERR_NUMBER$ ORA_ERR_MESG$                                                                    ORA_ERR_ROWID$     ORA_ERR_OPTYP$ ORA_ERR_TAG$
              31011 ORA-31011: XML parsing failed                                                    AAAF6PAAEAAAASnAAB U              My update process
                    ORA-19202: Error occurred in XML processing                                                                       
                    LPX-00244: invalid use of less-than ('<') character (use &lt;)                                                    
                    Error at line 5                                                                                                   
                    ORA-06512: at "SYS.XMLTYPE", line 272                                                                             
                    ORA-06512: at line 1                                                                                              
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reading  xml data from url and insert into table

    CREATE TABLE url_tab2
    URL_NAME VARCHAR2(100),
    URL SYS.URIType
    INSERT INTO url_tab2 VALUES
    (’This is a test URL’,
    sys.UriFactory.getUri(’http://www.domain.com/test.xml’)
    it is giving error as invalid character

    Check if your single quotes are the correct single quotes.
    The principle works as advertised in the XMLDB Developers Guide...
    C:\>sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.7.0 - Production on Tue Nov 25 21:44:46 2008
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create user OTN identified by OTN account unlock;
    User created.
    SQL> grant dba, xdbadmin to OTN;
    Grant succeeded.
    SQL> conn OTN/OTN
    Connected.
    SQL> CREATE TABLE uri_tab (docUrl SYS.URIType, docName VARCHAR2(200));
    Table created.
    SQL> -- Method SYS.URIFACTORY.getURI() with absolute URIs
    SQL> -- Insert an HTTPUri with absolute URL into SYS.URIType using URIFACTORY.
    SQL> -- The target is Oracle home page.
    SQL> INSERT INTO uri_tab VALUES
      2  (SYS.URIFACTORY.getURI('http://www.oracle.com'), 'AbsURL');
    1 row created.
    SQL> -- Insert an HTTPUri with relative URL using constructor SYS.HTTPURIType.
    SQL> -- Note the absence of prefix http://. The target is the same.
    SQL> INSERT INTO uri_tab VALUES (SYS.HTTPURIType('www.oracle.com'), 'RelURL');
    1 row created.
    SQL> -- Insert a DBUri that targets employee data from database table hr.employees.
    SQL>
    SQL> INSERT INTO uri_tab VALUES
      2  (SYS.URIFACTORY.getURI('/oradb/HR/EMPLOYEES/ROW[EMPLOYEE_ID=200]'), 'Emp200');
    1 row created.
    SQL> SELECT e.docUrl.getCLOB(), docName FROM uri_tab e;
    E.DOCURL.GETCLOB()
    DOCNAME
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
    ">
    <html>
    <head>
    AbsURL
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
    ">
    <html>
    E.DOCURL.GETCLOB()
    DOCNAME
    <head>
    RelURL
    <?xml version="1.0"?>
    <ROW>
      <EMPLOYEE_ID>200</EMPLOYEE_ID>
      <FIRST_NAME>Jenn
    Emp200
    SQL> set long 1000
    SQL> select HTTPURITYPE('www.oracle.com').getCLob() from dual;
    HTTPURITYPE('WWW.ORACLE.COM').GETCLOB()
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
    ">
    <html>
    <head>
    <title>Oracle 11g, Siebel, PeopleSoft |
    Oracle, The World's Largest Enterprise S
    oftware Company</title>
    <meta name="title" content="Enterprise Applications | D
    atabase | Fusion Middleware | Applicatio
    ns Unlimited | Business | Oracle, The Wo
    rld's Largest Enterprise Software CompanEdited by: Marco Gralike on Nov 25, 2008 10:13 PM

  • How to read data from PDF and HTML  file

    I have got solution to read text form .txt file but did'nt get code for PDF and HTML.
    I dont want to convert PDF to txt.
    Please help me ...

    ah crap i could have guessed there would be a crosspost only the forum in where the crosspost is made is abit funny
    To OP: DO NOT CROSSPOST
    http://forum.java.sun.com/thread.jspa?threadID=5267875&tstart=0

  • Could anyone tell me how to read 4 lines altogether and insert into table

    Hi ,
    I want to load the below data into table by using sql loader.
    First 4 lines should insert in one single row in table and again it should from '01' load the next 4 lines in another row.
    01suresh
    02works
    03in
    04bankok
    01kumar
    02works
    03in
    04abudabi
    01Raju
    02works
    03in
    04france
    Could you please give me some suggestion how i can accomplish it.
    Thanks in advance.
    Regards,
    Vino

    user1142030 wrote:
    First 4 lines should insert in one single row in table and again it should from '01' load the next 4 lines in another row.Not a problem, use CONTINUEIF. Control file:
    LOAD DATA
    INFILE *
    REPLACE
    CONTINUEIF NEXT PRESERVE(1:2) != "01"
    INTO TABLE continueif
    TRAILING NULLCOLS
    DUMMY FILLER POSITION(1:2),
    COL1 TERMINATED BY '02',
    COL2 TERMINATED BY '03',
    COL3 TERMINATED BY '04',
    COL4 TERMINATED BY '01'
    BEGINDATA
    01suresh
    02works
    03in
    04bankok
    01kumar
    02works
    03in
    04abudabi
    01Raju
    02works
    03in
    04france Now:
    SQL> create table continueif(
      2                          col1 varchar2(10),
      3                          col2 varchar2(10),
      4                          col3 varchar2(10),
      5                          col4 varchar2(10)
      6                         )
      7  /
    Table created.
    SQL> host sqlldr scott@orcl/tiger control=c:\temp\continueif.ctl log=c:\temp\continueif.log
    SQL> select * from continueif
      2  /
    COL1       COL2       COL3       COL4
    suresh     works      in         bankok
    kumar      works      in         abudabi
    Raju       works      in         france
    3 rows selected.
    SQL> SY.

  • How to read data from the Deep structure.

    Hi
    How to get from the deep structure. Means i have one table in that having onother structure. i need to read data from that inner structure.
    Regards
    Reddy

    Hi,
    you can access in the way u use for the normal structure, u should only consider a deep structure is a table without headerline.
    TABLES: BKPF, BSEG.
    TYPES: TY_ITEM TYPE TABLE OF BSEG.
    DATA:   BEGIN OF W_DOCUMENT,
                    HEADER TYPE BKPF,
                    ITEM       TYPE BSEG,
                 END    OF W_DOCUMENT.
    DATA: T_DOCUMENTS LIKE STANDARD TABLE OF W_DOCUMENT.
    Insert the data:
    SELECT * FROM BKPF WHERE ....
       W_DOCUMENT-HEADER = BKPF.
       SELECT * FROM BSEG INTO TABLE W_DOCUMENT-ITEM
                                       WHERE BUKRS = BKPF-BUKRS
                                            AND BELNR  = BKPF-BELNR
                                            AND GJAHR  = BKPF-GJAHR.
       APPEND W_DOCUMENT TO T_DOCUMENTS.
    ENDSELECT.
    Read the data:
    LOOP AT T_DOCUMENTS INTO W_DOCMENT.
    Header data
        WRITE: / W_DOCUMENT-HEADER-BUKRS,
                      W_DOCUMENT-HEADER-BELNR,
                      W_DOCUMENT-HEADER-GJAHR.
    Item data
        LOOP AT W_DOCUMENT-ITEM INTO BSEG.
             WRITE: / BSEG-BUZEI,
                           BSEG-WRBTR CURRENCY W_DOCUMENT-HEADER-WAERS.
        ENDLOOP.
    ENDLOOP.
    Regards,
    Padmam.

  • How to read data from writable PDF Form?

    Hi,
    I need some help for the web site that I am working on.
    This is asp.net website. Client is requesting to provide writeable PDF forms on this website for download.
    These forms will be downloaded by customers, they will fill in the required data on these forms save it and upload the forms back on the website.
    Once uploaded we need to read whtever client has written in these forms and update in the database (SQL server).
    I have been going through adobe web site and lot of other web sites to understand this concept (as i have never done this).
    What I understood is, with Adobe LiveCycle designer and forms we can create writeable forms.
    However I have not got any idea or seen any documentation on how do I read the data that user has typed on these forms.
    This reading the data from pdf and saving into sql server, I have to do it in asp.net app.
    Could anyone please help me understand how to achieve this.
    Thanks a lot for you time.

    How do we do that?
    Just to clarify myself, I am not putting any button on PDF to invoking submit action from PDF. I am allowing user to upload the pdf and they click submit button on my aspx page.
    Are you saying that when user submits the aspx page there is a wasy to retrieve the data in the form of XML or name/value pair on this aspx submit? if so please send me some pointers/examples or let me know how to do this? Is there any additonal tools/software that we will need to buy from adobe for this?
    thanks for you time!
    Praxo

  • How to read data from a CLUSTER STRUCTURE not cluster table.

    Hi,
    how to read data from a CLUSTER STRUCTURE not cluster table.
    regards,
    Usha.

    Hello,
    A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
    Regards,
    Mansi.

  • How to read data from a file that was formatted by excel?

    Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • How to read data from a connected modem

    any one can help me? how to read data from a connected modem. The modem received real-time data from other server. The data is in text format. I can see this text when I used hyperterminal for dial up and the data is accumulated such as:
    @aa1235678
    @bb2135647
    @cc5214367
    since it is real-time data, I want to read one line each time instantly when it arrives.

    You need to use the Java Communications API. (http://java.sun.com/products/javacomm/index.html)

Maybe you are looking for

  • My iPhone will not start but does show up on iTunes

    Hello, I've had my iPhone 4 for about 2 weeks and it was working just fine but 2 days ago i went camping and put my iPhone in my bag so it wouldn't get damaged,when I woke up the day after my phone wouldn't work. After I connected it to my laptop iTu

  • How to use "Start synchronous Call" to run a subVi and keep timeout event in Main vi still running?

    Hi, All I have a application need periodically check an instrument status and I put it in the "Timeout Event" in main vi. I also need call some subVis for configuration etc. Somehow when I called those subvi, the Timeout event in my main vi was not r

  • Keynote and Flash export. No sound in the flash file

    Oh well... Here I am again. I have recorded speech for my slide show as a narration and there is a sound file on every slide. The sound files are mp3s (Exported from Audacity as mp3 ID3v1). Come to playing the show and the sound doesn't play. All the

  • Camera quality

    I have a problem with the camera quality.The photos I take at dim light are really bad and the.photos are too grainy.Anyone faced this problem too.how can I fix it

  • Don't know how to move pics.from e-mail to my comps.desktop.Please help!

    <blockquote>Locking duplicate thread.<br> Please continue here: [[/questions/920202]]</blockquote> Hi- I took a few pictures with my cell phone,and sent them to my Google e-mail.Now I want to put them on my computers desktop.Don't know how to transfe