Populate a table reading the data from a TXT file

how can I populate a table reading the data from a TXT file?
thanks

Hey Kevin!
Using FORMS.TEXT_IO to bulk load data from a file strikes me as re-inventing the wheel. It is just about justifiable in a self-service environment, but I regard the EXTERNAL TABLE is a better solution for that situation as well.
The same applies to UTL_FILE. I think the ability to read text with UTL_FILE is primarily intended for read file-based configuration or file manipulation/processing rather than data loading.
Re-writing a text file into SQL statements is too much like hard work (even with an editor that supports macro definition and regular expressions) for no real benefit. You lose all the bulk load peformance you would get from SQL*Loader. But for QAD I'd probably let you off with it.
You missed out one obvious alternative: using Java to turn the contents of an XML file into a CLOB and inserting it into a table which is read by a PL/SQL procedure that parses the XML records and insert the retrieved data into a table.
Stay lucky, APC

Similar Messages

  • What is the 'quickest' way to read char data from a txt file

    Hello,
    What is the 'quickest' way to read character data from a txt file stored on the phone to be displayed into the screen?
    Regards

    To be even a bit more constructive...
    Since J2me does not have a BufferedInputStream, it will help to implement it yourself. It's much faster since you read large blocks at ones in stread of seperate chars.
    something line this lets you read lines very fast:
      while ( bytesread < filesize ) {
             length = configfile.read( buff, 0, buff.length );
             // append buffer to temp String
             if ( length < buff.length ) {
                byte[]  buf  = new byte[length];
                System.arraycopy( buff, 0, buf, 0, length );
                tmp.append( new String( buf ) );
             } else {
                tmp.append( new String( buff ) );
             // look in tmp string for \r\n
             idx1 = tmp.toString().indexOf( "\r\n" );
             while ( idx1 >= 0 ) {
                //if found, split into line and rest of tmp
                line = tmp.toString().substring( 0, idx1 );
             /// ... do with it whatever you want ... ////
                tmp = new StringBuffer( tmp.toString().substring( idx1 + 2 ) );
                idx1 = tmp.toString().indexOf( "\r\n" );
             bytesread += length;
          }

  • Updating Table using the data from a flat file

    Hi,
    I have a table called emp;
    Name,
    empno,
    accountno,
    amount.
    This table is filled with values of name and empno.
    The columns accountno and amount are empty.
    I have a flat file created in some folder.
    Contents of the flat file can be like this:
    mani | 23 | 123 | 1000
    spr | 22 | 342 | 2133
    asjf | 54 | 432 | 2345
    I need to access the file in the specified location, read all the records one after the other in the flat file and update the table "emp" with the values in the flat file.
    Row after row all the records in the file should be updated to the table.
    I found out some way to do this - its sqlloader - But it loads the data from a file to the table - i dont need that - i need to update the table.
    Let me know how this can be solved ?????????
    Thanks in advance.......

    Just to clarify Andrew's point, you can use external tables as the source table for an UPDATE statement. You cannot use them as a target for an UPDATE statement (i.e. you can't update the text file from an Oracle table).
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to read the data in a txt file on a web site?

    I want to extract the numbers located in txt files on a web site. It's a normal url. Not a ftp.
    Does anyone know how to do it?

    Hi Tom,
    What do you want to extract from the text file??
    I wanted to extract an IP address from a pearl script from my FTP server and this was the vi that I used .I dont know if you are trying to do the same?
    Here is the vi.It is in LV 7.1
    Hope its helps .
    Good luck.
    ohiofudu.
    Certified LabVIEW Architect
    Certified TestStand Developer
    Attachments:
    PublicIP-Adresse.vi ‏31 KB

  • How to read the data from an excel file into MYSQL by java language

    Hi all,
    I have some data in excel spread sheet and I want to put the data into MYSQL data base. I created the tables in MYSQL> How can I write a program in JAVA that puts the value from excel sheet to mysql??
    I would appreciate your help
    regards

    By typing code at the keyboard... but presumably you meant to ask what code you should type.
    To get data out of Excel there are a few alternatives. The Google keywords I would use to find them are "java excel". I use Apache POI but there are other possibilities, I believe. As for getting the data into MySQL once you have extracted it from Excel, you would use JDBC. But you already knew that, didn't you? You did find the JDBC forum.
    In general it's better to ask a specific question on a forum. If you don't have a clue (which is the way we all start out) then just telling people that isn't going to be helpful. The best you're going to get is links to tutorials, which you could perfectly well have found for yourself by simple web searches.

  • Is there any way to read the data from an excel file w/o using a loop structure?

    I am retrieving a large amount of data (multiple sheets) from an excel file and would like to extract the entire range without retrieving individual cell values(too slow). I can write an range all at once but cannot read it.

    If you are able to write a block of data, then you should be able to read a block. The four requirements that you want to verify are:
    1. The Range specified must match the exact size and location of the data block you want to read
    2. The returned data is in a 2D array of Variants (either strings or numbers)
    3. Use Variant to Data to convert to 2D DBL or 2D Strings
    4. Check for the correct orientation for your application (use transpose if it is not)
    Michael Munroe
    Certified LabVIEW Developer
    www.abcdef.biz
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • How to update a table AUTOMATICALY with data from a .txt file??

    HI ,
    I want to upload data which is in a notepad file and Create a table. This notepad file stores a string of datas. Here, the data comes in to the .txt file every second.
    (The data is actually stored into the notepad file when a program is executed in Processing.js software)
    Is it possible to do the following using APEX ? ?
    1. This table has to be updated automatically once in 2 minutes (I want this completely automatic, no human intervention -- no update buttons)
    2. A report is to be created in a apex application with this table, it should reflect the updates in the table every 2 minutes.
    Is it possible?? give your ideas.. I want to do this soon for my engineering project :) Any help from you is appreciated. :)
    Edited by: user13301695 on 28-Mar-2011 10:09

    And how do you expect your database server to access a local file in your machine ?
    Is the file accessible from outside your machine say inside a webserver folder so that some DB process can poll on the file ?
    Or, is your DB server in the same machine where you have the text file ?
    You will have to figure out the file acess part before automating user interaction or even auto-refreshing.

  • How can i Read the Data from such Excel files?

    Dear All,
            Here I am attaching an excel file in which all the datat cells have more than one data, can anybody tell me, how to read from such kind of excel files?
    Thanks in Advance & Happy New Year,
    Rujuta

    Greetings Ruju,
    Here is what I do to read such a file:
    I first save the Excel file (xls) as CSV file (which is easier to handle: Comma Seperated Values) .. Open the file using Excel and save it CSV.
    Then using the code attached I get all these values in a string array.
    Hope this helps
    Ayman Mohammad Metwally
    Automation Engineer
    Egypt - Cairo
    Attachments:
    CSV2ARRAY.vi ‏29 KB

  • Reading the data from XML Source

    Hi
    i want to read the data from XML source file, and update the transaction information to another XML file. how we can do this in ADF, please help
    Thanks
    nidhi

    you may use normal Java API to do that
    http://www.javablogging.com/read-and-write-xml/

  • Regarding reading the data from spool

    Hi Experts,
    How can i read the data from spool?
    I need to read the data from the spool and should display on the screen?
    Is there any FM to read the data from spool?
    Sruthi.

    hi please use this..
    CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
        EXPORTING
          rqident              = v_spool
        TABLES
          buffer               = it_spool
        EXCEPTIONS
          no_such_job          = 1
          not_abap_list        = 2
          job_contains_no_data = 3
          selection_empty      = 4
          no_permission        = 5
          can_not_access       = 6
          read_error           = 7

  • Reading the data from BLOB column

    HI,
    I have a table with following structure
    Test_Mail(Attachment BLOB,Attachmentname varchar2(255),FileSize number)
    The data in the table is like
    Attachment|Attachmentname|FileSize
    BLOB|test.txt|1236
    I wants to read the data from the BLOB attachment in to new file.
    can any one help me in doing this with plsql??
    Thanks in advance,
    Balaji tk.
    Edited by: Balaji.tk on Jan 9, 2011 9:28 PM

    May be something like this ?
    DECLARE
       l_file       UTL_FILE.FILE_TYPE;
       l_buffer     RAW (32767);
       l_amount     BINARY_INTEGER     := 32767;
       l_pos        INTEGER            := 1;
       l_blob       BLOB;
       l_blob_len   INTEGER;
    BEGIN
    -- Open the destination file.
       l_file := UTL_FILE.FOPEN ('TEST_DIR', v_attachment_name, 'wb');
       --This v_attachment_name can be selected from your table.
    -- Get LOB locator
    FOR rec IN (
    SELECT attachment   l_blob
          FROM test_mail
         --Your where condition to find the row.      
       --AND ROWNUM =1
    LOOP
       l_blob_len := DBMS_LOB.getlength (rec.l_blob);
    -- Read chunks of the BLOB and write them to the file
    -- until complete.
       WHILE l_pos < l_blob_len
       LOOP
          DBMS_LOB.READ (rec.l_blob, l_amount, l_pos, l_buffer);
          UTL_FILE.put_raw (l_file, l_buffer, FALSE);
          l_pos := l_pos + l_amount;
       END LOOP;
      commit;
    END LOOP;
    -- Close the file.
       UTL_FILE.FCLOSE (l_file);
    EXCEPTION
       WHEN OTHERS
       THEN
    -- Close the file if something goes wrong.
          IF UTL_FILE.IS_OPEN (l_file)
          THEN
             UTL_FILE.FCLOSE (l_file);
          END IF;
          RAISE;
    END;

  • When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI

    When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI( I am not getting any error message in E$_TARGET_ANI_TEST).
    When i am running the interface i am getting the below error against the errored step
    "ORA-01045: user ABC lacks CREATE SESSION privilege; logon denied."
    Only E$_TARGET_ANI_TEST  is created with no data. No such tables like C$_0TARGET_ANI_TEST, I$_TARGET_ANI_TEST are created and also data is not inserted in the target table TARGET_ANI_TEST.

    Hi,
    I have checked that only E$ table is created. C$ and I$ table are not created ( I have selected my target schema as the part for the staging table).
    All the parameters for dropping the tables are selected as "<default>:false".
    I am importing the following KMs with the following parameters:
    1) CKM Oracle
    DROP_ERROR_TABLE
    :false
    DROP_CHECK_TABLE
    :false
    CREATE_ERROR_INDEX
    :true
    COMPATIBLE
    :9
    VALIDATE
    :false
    ENABLE_EDITION_SUPPORT
    :false
    UPGRADE_ERROR_TABLE
    :false
    2) LKM SQL to SQL
    DELETE_TEMPORARY_OBJECTS
    :true
    3) IKM SQL Incremental Update
    INSERT
    :true
    UPDATE
    :true
    COMMIT
    :true
    SYNC_JRN_DELETE
    :true
    FLOW_CONTROL
    :true
    RECYCLE_ERRORS
    :false
    STATIC_CONTROL
    :false
    TRUNCATE
    :false
    DELETE_ALL
    :false
    CREATE_TARG_TABLE
    :false
    DELETE_TEMPORARY_OBJECTS
    :true 

  • TO Read the data from the I/P payload of the proxy

    I want to know is there any function module or report available to read the data from the
    payload of the proxy. As we can see the data in the input payload for the prticular
    message in sxmb_moni tcode.Is there any table where this data will be stored.
    And also I have to update one Ztable with XML Message ID,Sender Interface Namespace,
    Sender Interface Name as and when this proxy is triggered. For this I will have to implement the
    class for the interface in the sproxy tcode and in this implementation i will update this
    ztable but my problem is how will i get this values there.
    In debugging I found one report  rsxmb_display_msg_vers_new is submitted in sxmb_moni to show ll these details but
    looking specially foe the paylod data.
    Your help is highly appreciated.
    Thanks.

    Hello PawanG ,
    It is very simple to find out all DB tables involved in the rsxmb_display_msg_vers_new . Steps below:
    1. run tcode SE30
    2. click "program" radio box, input RSXMB_DISPLAY_MSG_VERS_NEW as program name, click "Execute" button.
    3. input an valid message uuid in the "Message GUID" field and execute.
    4. go back to SE30,click "Evaluate" tab
    5. click "DB tables".
    Then all DB table name and description are listed there. I am sure you can find what you need. Good luck!
    Best Regards,
    Jerry

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

Maybe you are looking for

  • Dzen, conky and wmii statusbar...

    Hi, [What I need] I'm trying to get a system info statusbar working on my wmii setup. [What I've done so far] 1. Using wmii's statusbar directly is too difficult for me as I don't have enough knowledge about my system to get all the information I nee

  • After I updated iTunes neither my nano or shuffle will connect

    I have the newest version of the shuffle and a first generation nano. after I updated my iTunes recently, neither of the two are showing up in my computer or iTunes. I have gone through all of the troubleshooting details and still nothing works. plea

  • Can any one tell me how to write open hubs to application server?

    Hello Everone, I created open hubs and my requirement is to write the file to application server. So, I created logical file name and logical paths as specified in below link. http://help.sap.com/SAPHELP_NW04S/helpdata/EN/8d/3e4ec2462a11d189000000e83

  • 1.0 update

    Where can I get the update 1.0 to downgrade from 1.1? Only 1.1 came on my disc with the ipod I prchased last weekend.... My DVD movies are hanging after 30 sec then continue without sound.... Thanks

  • Slideshow taken off facebook

    How can use a slide show I created using iphoto with music from iphoto in facebook.  It was taken off facebook because of author rights of the music I put in. Please direct me the right way.  Thank you.