Bulk Data - Insert / Update from text file - Urgent

hi,
Consider there is a Table A. There are around 1.7 Million
Records.
i have a situation that i will be getting the Data,
Every two Weeks, around 100 - 200 thousand Records.
I have to do some calculations.
If any Old Data Exists, then update the Data
for the Non - Primary Key Fields.
Else
I have to Insert the New Data.
Most of the time, i will be getting update information.
very few hundreds, insert records.
Please, help me, by providing the techniques or tools.
Is it posssible to automate the whole process.
Sreedhar V
null

Sreedhar V (guest) wrote:
: hi,
: Consider there is a Table A. There are around 1.7 Million
: Records.
: i have a situation that i will be getting the Data,
: Every two Weeks, around 100 - 200 thousand Records.
: I have to do some calculations.
: If any Old Data Exists, then update the Data
: for the Non - Primary Key Fields.
: Else
: I have to Insert the New Data.
: Most of the time, i will be getting update information.
: very few hundreds, insert records.
: Please, help me, by providing the techniques or tools.
: Is it posssible to automate the whole process.
: Sreedhar V
Here's a process that might help:
create a temporary table the same format as the flat file.
create a sqlldr control file to load the data from the file into
the temp table
create a pl\sql or JAVA script to cursor through the records
from the temp table and for each row see if there is a match on
TABLE A. If so this is an update, if not it is an insert.
If you are in a Unix environment you can write a shell script to
automate the whole process and schedule it in kron.
null

Similar Messages

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • Table update from text file on server

    How do I get a table in dreamweaver to update from a text
    file thats on the server it will be posted on? Do I need to use
    some sort of weird coldfusion or asp.net, or can i do it in basic
    html. It would be sweet to make happen for my portfolio news
    section ... thanks!

    Hello,
    What you need is to know the structure (fields) of your internal table LS_BKPF at runtime.
    The standard SAP class CL_ABAP_TYPEDESCR contains Methods to describe not only repository structures but also variables used in your ABAP program.
    DESCRIBE_BY_DATA : Description of data object type
    DESCRIBE_BY_NAME : Description of object type using relative/absolute names
    DESCRIBE_BY_OBJECT_REF : Description of object type using reference
    DESCRIBE_BY_DATA_REF : Description of data object type using reference
    Example on how to do this can be found here :
    [http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID1687263150DB21033411053326729243End?blog=/pub/wlg/2071|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID1687263150DB21033411053326729243End?blog=/pub/wlg/2071]
    After you have retrieved the fieldnames of your internal table at runtime you can add them in the first line of your dataset.
    Success.
    Wim

  • Update/delete text file - Urgent

    hi guys, i have a text file. Using io package i would like to search a particular string in the file. when i got the search string either i have to update some text in that row or i have to delete the row. how can i do that. If any one tried pls let me know with code. Ur valuable suggestion are welcome.
    thax in advance

    An obvious method is to copy the whole file with the changes made into a temporary file .
    After the operation delete the orginal file and rename the temporary file to orginal file.

  • Insert / Update from Oracle Forms -- URGENT Please thanks

    Hello All,
    I need to create form which can be use for two purposes. i.e insert and update
    I have one table called emp which has 50 columns.
    Only four columns has not null constraint.
    I need to insert values in only these columns.
    From SQLPLUS it can be cone as below:
    insert ito emp values ('333','2222','007','AA','01-JAN-2007','','','','','','','','','',........);
    After that I need to update one of the coulmn with the value as
    update emp
    set zipcode = 'Y'
    where empt# = 007;
    How could I achive this from Oracle form.
    Any help will be appricated.
    D

    Why handle updates in the On-Update trigger? Oracle Forms already handles this for you. You update a data value in a field and click on the SAVE button (assuming you have a Save button) and the Oracle Forms handles the Update. The On-Update trigger is provided so you can perform processing in addition to the default UPDATE.
    Craig...

  • Cant get data from text file to print into Jtable

    Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
    void dbTest() {
    DataInputStream dis = null;
    String dbRecord = null;
    String hold;
    try {
    File f = new File("customer.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    Vector dataVector = new Vector();
    Vector headVector = new Vector(2);
    Vector row = new Vector();
    // read the record of the text database
    while ( (dbRecord = dis.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(dbRecord, ",");
    while (st.hasMoreTokens()) {
    row.addElement(st.nextToken());
    System.out.println("Inside nested loop: " + row);
    System.out.println("inside loop: " + row);
    dataVector.addElement(row);
    System.out.println("outside loop: " + row);
    headVector.addElement("Title");
    headVector.addElement("Type");
    dataTable = new JTable(dataVector, headVector);
    dataTableScrollPane.setViewportView(dataTable);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
    try {
    dis.close();
    } catch (IOException ioe) {
    } // end if
    } // end finally
    } // end dbTest

    Here's a thread that loads a text file into a JTable:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=315172
    And my reply in this thread shows how you can use a text file as a simple database:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=342380

  • FM or Way to validate Date format. The date is from TEXT File

    Dear All,
    I need to validate a date field whether it is in proper format.
    The field is coming from TEXT file to Internal table by using FM GUI_UPLOAD.
    Can any one give me the FM name or guide me how to do that?
    Definitely points will be given for correct solution.
    Thanks & Regards,
    Neeraj

    try the function module 'DATE_CHECK_PLAUSIBILITY'
      call function 'DATE_CHECK_PLAUSIBILITY'
           exporting
                date                      = '23.09.2007'
           exceptions
                plausibility_check_failed = 1
                others                    = 2.
      if sy-subrc <> 0.
        write:/ 'Please verify the date'.
        exit.
      endif.

  • CO-PA load data from text file

    Hello
    At present, in our company, we load data from Excel files to CO-PA. Is there any way to load those data to CO-PA from text files ?
    I will be grateful for any suggestions.

    You can create a structure using KEFA, assign the Value fields in KEFB and then use KEFC to upload data against that structure.
    You have various file format options, but I don't think Excel is one of them... you have have to save the file as txt and upload.
    Play around with those transactions and come back if you need additional help.
    Cheers.

  • Unable to Upload data from text file into BEx Analyzer selection screen

    Hi,
    No response from BEx Analyzer when I am trying to upload around 40,000 material from text file into BEx Analyzer selection screen using "Upload selections" options. But I am able to upload only 10,000 material from text file.  I never faced same kind of issue when I am using BEx Analyzer 3.x.  Please let me know I have to change any settings related to BEx or any other.
    Thanks
    Sri Krishna Ponnada.

    Hello
    It seems you are reaching the .NET memory limitation informed in note 1040454.
    Because 3.5 does not use .NET it can work that.
    Regards,
    Ricardo

  • LabVIEW for ARM 2009 Read from text file bug

    Hello,
    If you use the read from text file vi for reading text files from a sdcard there is a bug when you select the option "read lines"
    you cannot select how many lines you want to read, it always reads the whole file, which cause a memory fault if you read big files!
    I fixed this in the code (but the software doesn't recognize a EOF anymore..) in CCGByteStreamFileSupport.c
    at row 709 the memory is allocated but it tries to allocate to much (since u only want to read lines).
    looking at the codes it looks like it supposed to allocated 256 for a string:
    Boolean bReadEntireLine = (linemode && (cnt == 0)); 
    if(bReadEntireLine && !cnt) {
      cnt = BUFINCR;    //BUFINCR=256
    but cnt is never false since if you select read lines this is the size of the file!
    the variable linemode is also the size of the file.. STRANGE!
    my solution:
    Boolean bReadEntireLine = (linemode && (cnt > 0));  // ==
     if(bReadEntireLine) {    //if(bReadEntireLine && !cnt) {
      cnt = BUFINCR;
    and now the read line option does work, and reads one line until he sees CR or LF or if the count of 256 is done.
    maybe the code is good but the data link of the vi's to the variables may be not, (cnt and linemode are the size of the file!)
    count should be the number of lines, like chars in char mode.
    linemode should be 0 or 1.
    Hope someone can fix this in the new version!
    greets,
    Wouter
    Wouter.
    "LabVIEW for ARM guru and bug destroyer"

    I have another solution, the EOF works with this one.
    the cnt is the bytes that are not read yet, so the first time it tries to read (and allocate 4 MB).
    you only want to say that if it's in line mode and cnt > 256 (BUFINCR) cnt = BUFINCR
    the next time cnt is the value of the bytes that are not read yet, so the old value minus the line (until CR LF) or if cnt (256) is reached.
    with this solution the program does not try to allocate the whole file but for the max of 256.
    in CCGByteStreamFileSupprt.c row 705
     if(linemode && (cnt>BUFINCR)){
       cnt = BUFINCR;
    don't use the count input when using the vi in line mode. count does not make sense, cnt will be the total file size. also the output will be an array.
    linemode seems to be the value of the file size but I checked this and it is just 0 or 1, so this is good
    update: damn it doesn't work!
    Wouter.
    "LabVIEW for ARM guru and bug destroyer"

  • Read from text file vi won't read file...

    I am very new to LV programming so I hope you forgive any stupid mistakes I am making.   I am using Ver. 8.2 on an XP machine.
    I have a small program that stores small data sets in text files and can update them individually or read and update them all sequentially, sending the data out a USB device.   Currently I am just using two data sets, each in their own small text file.  The delimiter is two commas ",,".
    The program works fine as written when run in the regular programming environment.   I noticed, however, as soon as I built it into a project that the one function where it would read each file sequentially to update both files the read from text file vi would return an empty data set, resulting in blank values being written back into the file.   I read and rewrite the values back to the text file to place the one updated field (price) in it'sproper place.  Each small text file is identified and named with a 4 digit number "ID".   I built it twce, and get the same result.  I also built it into an installer and unfortunately the bug travelled into the installation as well.
    Here is the overall program code in question:
    Here is the reading and parsing subvi:
    If you have any idea at all what could cause this I would really appreciate it!
    Solved!
    Go to Solution.

    Hi Kiauma,
    Dennis beat me to it, but here goes my two cents:
    First of all, it's great to see that you're using error handling - that should make troubleshooting a lot easier.  By any chance, have you observed error 7 when you try to read your files and get an empty data set?  (You've probably seen that error before - it means the file wasn't found)
    If you're seeing that error, the issue probably has something to do with this:
    Relative paths differ in an executable.  This knowledge base document sums it up pretty well. To make matters more confusing, if you ever upgrade to LabVIEW 2009 the whole scheme changes.  Also, because an installer contains the executable, building the installer will always yield the same results.
    Lastly, instead of parsing each set of commas using the "match pattern" function, there's a function called "spreadsheet string to array" (also on the string palette) that does exactly what you're doing, except with one function:
    I hope this is helpful...
    Jim

  • Dynamically load content into a "template" swf from text file

    I have a dream....
    Well, I have a concept. I have not actively pursued Flash in
    several years, though I've continued to have it in my arsenal. I've
    not done much in the action scripting realm for a while though.
    I am trying to create a template that will be used for about
    100 different product pages.
    It would have two tabs, basically, 2 different graphical
    button sets. One will have up to 4 links to similar products, each
    tab will be on the side of a square, and I need the ability to not
    display a tab if there is no actual link.
    As for the other tab, Its a menu that consists of a series of
    lines. This can be an external menu, I just need a way to have
    flash load the right menu. This menu, when you mouse over a line,
    the name of the product appears, as well as a product image that
    gets loaded with the menu. The product images would be external,
    allowing me to simply replace an image if a new higher end version
    of the product comes out.
    So, I am totally not an actionscripter. Looks like I need to
    load variables from an external file. Can I set a property in the
    flash code on the html that tells the movie what dataset to grab
    from?
    Here's basically what I am looking for
    property: value
    (load variables for:)
    item: 44
    (menu1)
    faster: 54b.html
    slower: 34d.html
    left: 43d.html
    right: 45c.html
    (menu2)
    menu:graph5.swf
    (menu loads images from external source)
    link51: 51d.html
    link52: 52c.html
    link53: 53c.html
    link54: 54d.html
    link55: 55b.html
    link56: 56d.html
    A possible third menu would be text driven, and would use
    html to link to various items.
    This is a static site, so urls will be fixed.
    Is it best to build a php page that serves up data for a
    single item, or do one big text file with all 100 or so items? Is
    that even possible?
    My Flash since MX is very rusty. I am using Flash Pro8. I
    would love to create a single file so modifications are to the text
    files, unless a new item is released, then it's updating a single
    flash menu and updating the text file.
    Been spending way too much time in InDesign lately! I used to
    be pretty good at Flash!

    well sorry there fanmap - but I don't think you're going to
    be able to get this to work. here's why: the link points to a php
    file - which gathers dynamic info from a DB - the return from the
    php is generating a string that is based on the DOM and
    'constructs' a javascript method that in turn writes to the html
    document. although we can embed html into a textField in Flash
    there are a limited number of supported html tags - and JS methods
    will not operate internally. in addition, (i'm not certain someone
    correct this if i'm off) there's no way to 'change' the output of
    the php call, therefore you will not be able to read the return
    because it is designed to use the DOM and write solely to the
    current document. Even if you were to access the JS method from the
    swf file (which one can) it will still only write the content of
    the php return to the html document - and the output is not
    compatible with the textField class.

  • Power Shell - Read from text file

    Looking to see how to output select data from c:\test\test.txt file to c:\test\output.txt based on the following condition.
    Select data from text file that has a category of "Salads" and only return the name of the Salad to a text file.
    test.txt contains the following data
    1062,9971,Small Salad,,"40:""Salads"
    1063,9972,Large Pizza,,"60:""Pizzas"
    1065,9972,Large Salad,,"40:""Salads"
    Desired output
    Small Salad
    Large Salad

    Here's a couple options. Import the file as a CSV file, but only import the first three sections between commas. For instance, the first line of your test.txt file would import as 1062, 9971, and Small Salad. Then check for the word salad and write it out
    if it exists. Here's an example.
    $File = Import-Csv -Path C:\test\test.txt -Header One,Two,Three
    Foreach ($Entry in $File) {
    If ($Entry.Three -like '*salad') {
    Write-Output $Entry.Three
    As well, you could import all the contents of the file by changing the -Header parameter to One,Two,Three,Four,Five. Doing this, however, will mangle the data in Five because of the double quotes: "40:""Salads" would become 40:"Salads.
    Then you could do this the way to wanted to do this, by checking the category of salads. Here's an example of this, as well.
    $File = Import-Csv -Path C:\test\test.txt -Header One,Two,Three,Four,Five
    Foreach ($Entry in $File) {
    If ($Entry.Five -like '*salads') {
    Write-Output $Entry.Three
    Update: There are ways to read it in as a text file using Get-Content and then scanning each line, but because your source file has comma deliminators, it makes better sense to read it in as a CSV. To write this to a file, replace the Write-Output command with
    Add-Content -Value $Entry.Three -Path C:\test\output.txt

  • JTable - Help with updating a Text File

    Hi all,
    I've been fighting this for a few days. I am trying to update a Text File with my JTable.... Displaying the data works great but when I try to edit a cell/field on the gui, I'm bombing out...... My text fiel is a small user control file with Id, Name,
    Date, etc etc with the fields delimited with a "|".... I have built an Abstract Data Model (see below).... and I think my problem is in the setValueAt method.......
    Thanks so much in advance!!!!
    Mike
    code:
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.*;
    public class DataFileTableModel extends AbstractTableModel {
    protected Vector data;
    protected Vector columnNames ;
    protected String datafile;
    public DataFileTableModel(String f){
    datafile = f;
    initVectors();
    public void initVectors() {
    String aLine ;
    data = new Vector();
    columnNames = new Vector();
    try {
    FileInputStream fin = new FileInputStream(datafile);
    BufferedReader br = new BufferedReader(new InputStreamReader(fin));
    // extract column names
    StringTokenizer st1 =
    new StringTokenizer(br.readLine(), "|");
    while(st1.hasMoreTokens())
    columnNames.addElement(st1.nextToken());
    // extract data
    while ((aLine = br.readLine()) != null) { 
    StringTokenizer st2 =
    new StringTokenizer(aLine, "|");
    while(st2.hasMoreTokens())
    data.addElement(st2.nextToken());
    br.close();
    catch (Exception e) {
    e.printStackTrace();
    public int getRowCount() {
    return data.size() / getColumnCount();
    public int getColumnCount(){
    return columnNames.size();
    public String getColumnName(int columnIndex) {
    String colName = "";
    if (columnIndex <= getColumnCount())
    colName = (String)columnNames.elementAt(columnIndex);
    return colName;
    public Class getColumnClass(int columnIndex){
    return String.class;
    public boolean isCellEditable(int rowIndex, int columnIndex) {
    return true;
    public Object getValueAt(int rowIndex, int columnIndex) {
    return (String)data.elementAt( (rowIndex * getColumnCount()) + columnIndex);
    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    Vector rowVector=(Vector)data.elementAt(rowIndex);
    rowVector.setElementAt(aValue, columnIndex);
    fireTableCellUpdated(rowIndex,columnIndex);
    // return;
    }

    No, the DefaultDataModel does not update the physical data file. It is just used to store the data as you type in the table cells.
    The code from above is used to read data from a file and populate the DataModel.
    Now you need to write another routine that will take the data from the DataModel and write it to your file. I have never actually done this but I think the code would be something like:
    int rows = table.getModel().getRowCount();
    int columns = table.getModel().getColumnCount();
    //  Write column headers
    for (int j = 0; j < columns; j++)
         TableColumn column = table.getColumnModel().getColumn(j);
            Object o = column.getHeaderValue();
         writeToFile( o.toString() + "|" );
    writeToFile( "\n" );
    // Write each row
    for (int i = 0, i < rows; i++)
        for (int j = 0, j < columns; j++)
            Object o = table.getValueAt(i, j);
            writeToFile( o.toString + "|" );
        writeToFile( "\n" );
    }If you need to update the file whenever data in a cell changes, then you could extend the DefaultTableModel and override the setValueAt() method to also write the contents of the DataModel to a file. But this is a lot of overhead since it rewrite the entire file for every cell change.

  • How to open saved files using 'read from text file' function

    Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?
    Here are some screenshots on part of my program  
    let me know if you guys would need more information / screenshots thank you!
    Attachments:
    ss_save.jpg ‏94 KB
    ss_open.jpg ‏94 KB
    modified_writetotextfile.jpg ‏99 KB

    Ohmy, thanks altenbach. oh yeah i forgot about those sub VIs. will upload them now. Was rather demoralized after reading the comments and really struck me on how weak i'm at on labview really hope to get this done. But of course i have to study through and see how it works. Actually i am going to replace those 'signal generators sub vi' with ThoughtTechonology's sample code so i can obtain data waveforms real-time using Electrocardiography (ECG) ,Electromyography (EMG ) and Electroencephalography (EEG) hopefully i can find out how to connect the sample code.
    ( ps . cant connect it now unless my program is working otherwise labview will crash ) 
    ( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose )
    The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project
    Attachments:
    frequency detactor.vi ‏53 KB
    signal generator.vi ‏13 KB
    attachment.ashx.vi ‏40 KB

Maybe you are looking for