Update huge table(30 Millions) using huge table (30 Millions) on daily basis

Hi,
We are building a datamart for one of the financial systems. For the same we have 2 tables:
1. Temp table which will hold the summary of balances at customer level.
2. The actual fact table where the summaries will be updates.
Fact table will have complete data of all the customers where as temp table will have nearly same records.
We have tried using merge into clause (with Parallel option). But its taking too much time (already been more than 24 hours and no output).
What should be the optimal way to handle the same?
Fact table : Has index on cust id
Temp table : No index ( as all rows will be scanned)
Query is as follows:
/*+ <<PARALLEL OPTION CODE IS HERE + */
Merge into Fact from Temp using(Fact.custid=temp.custid)
on col1=newcol1,col2=newcol2 ...
Kindly help how to proceed.
Regards,
Bhavin

Hey Jonathan,
Below is the SQL and Explain plan...
MERGE
/*+PARALLEL(CSV) PARALLEL(TMP)*/
INTO TARGET CSV USING SOURCE TMP ON (CSV.T_PK= TMP.T_PK)
WHEN MATCHED THEN
  UPDATE
  SET CSV.T1 = TMP.T1;
This has 12 other columns in the update and no inserts. Nothing gets deleted after the load here.
There is a PK on the CSV.T_PK field but no PK or index on TMP table.
OPERATION
OPTIONS
OBJECT_NODE
OBJECT_NAME
OBJECT_INSTANCE
OBJECT_TYPE
OPTIMIZER
POSITION
COST
CARDINALITY
BYTES
MERGE STATEMENT
ALL_ROWS
143825
143825
17576549
5940873562
MERGE
TARGET
1
PX COORDINATOR
1
PX SEND
QC (RANDOM)
:Q1002
:TQ10002
1
143825
17576549
7206385090
VIEW
:Q1002
5
1
HASH JOIN
BUFFERED
:Q1002
1
143825
17576549
7206385090
PX RECEIVE
:Q1002
1
1212
17576549
421837176
PX SEND
HASH
:Q1000
:TQ10000
1
1212
17576549
421837176
PX BLOCK
ITERATOR
:Q1000
1
1212
17576549
421837176
TABLE ACCESS
FULL
:Q1000
TARGET
4
TABLE
ANALYZED
1
1212
17576549
421837176
PX RECEIVE
:Q1002
2
99314
35202438
13588141068
PX SEND
HASH
:Q1001
:TQ10001
1
99314
35202438
13588141068
PX BLOCK
ITERATOR
:Q1001
1
99314
35202438
13588141068
TABLE ACCESS
FULL
:Q1001
TARGET
2
TABLE
ANALYZED
1
99314
35202438
13588141068
The counts are as follows:
CSV(TARGET): 35 mIllion
TMP(SOURCE): 17.5 million.
We ran this merge and it took 22 hours to complete.
The index is not getting used even now for the CSV access. Please suggest.
Regards,
Anupam.

Similar Messages

  • I use two PC's on a daily basis, both using 3.6.7. One does everything I would expect with regard to history, the other consistently loses history data, with no real pattern as to what it keeps and what it doesn't. Tried adjusting custom settings but no

    I use two PC's on a daily basis, both using 3.6.7. One does everything I would expect with regard to history, the other consistently loses history data, with no real pattern as to what it keeps and what it doesn't. Tried adjusting custom settings but nothing works.

    oops! that should've been 3.6.8!

  • Doubt in updating database table

    hi all
    i want to modify values ztable from a internal table ....
    for eg : the ztable contains matnr and accept_qty
    matnr   qty
    mat01   
    mat02
    i need to modify qty of the table .. i am using where condition (ie modify where matnr = ) but where condition is not working for database tables .... how to proceed with this ..
    thanks
    lokesh

    hi,
    before that :- modify statemnt will modify a record if there is record having the same key like that of record in work area.
    if there is no record in itab with key of work area record, it will insert a new record in itab.
    look this sample code.
    *modify internal table
    loop at itab into wa.
    wa-field1 = data1.
    wa-field2 = data2.
    wa-field 3= data3.
    modify itab from wa transporting field1 field2 field3 where key_field = wa-keyfield. "there shuld not be any chang in key field.
    endloop.
    *now update database table
    *work area and data base structure shuld be same type
    if itab[] is not initial.
    modify ztable from table itab.
    endif.
    rgds
    anver
    if hlped pls mark points

  • How to update a table with huge data

    Hi,
    I have a scenario where I need to update tables that are having huge data (each table is having more than 10,00000)
    I am writing this update in PLSQL block.
    Is there any way to improve the performance of this update statement? Please suggest...
    Thanks.

    user10403630 wrote:
    I am storing all tables and columns that needs to be updated in tab_list and forming a dynamic qry.
    for i in (select * from tab_list)
    loop
    v_qry := 'update '||i.table_name||' set '|| i.column_name ' = '''||new_value||'''' ||' where '||i.column_name = ''||old_value||'''';
    execute immediate v_qry;
    end loop;Sorry to say so but this code is aweful!
    Well the only thing to make this even more slow would be to add a commit inside the loop.
    Some advices. But I'm not sure which one works in your case.
    The fastest way to update a million rows is: write a single update statement. On typical systems this should only run for like a couple of minutes.
    if you need to update several tables then write a single update for each table.
    If you have different values that need to be updated then find a way how to consider those different values in a single update or merge statement. Either by joining another table or by using some in-lists.
    e.g.
    update myTable
    set mycolumn = decode(mycolumn
                                     ,'oldValue1','newvalue1'
                                     ,'oldValue2','newvalue2'
                                     ,'oldValue3','newvalue3')
    where mycolumn in ('oldValue1','oldvalue2','oldvalue3'....);If you need to do this in pl/sql then
    1) use bind variables to avoid hard parsing the same statement again and again
    2) use bulk binding to avoid pl/sql context switches

  • Recordset - updating 2 tables with 1 recordset using application object update record

    I have a recordset that uses a field from 2 different tables
    with a select statement where clause that joins a userid. I can
    display the field’s data just fine. Now I want to use the
    Application object “update record” so I can modify
    either of the fields. The problem is the Application object
    “update record” only allows you to update one table.
    How does Dreamweaver mx 2004 allow me to update 2 tables with one
    recordset and 1 submit button? Currently using php.
    Example of where:
    Where member.userid = member_detail.userid
    I tried creating the one form with the field from the first
    table and that works just fine. I added the other field from the
    other table into the form but ofcourse there isn’t any code
    that will update the second table so it won’t work.
    My application requires me to update alot of fields between 2
    tables at the same time.
    Does anyone know a way using Dreamweaver mx 2004 to do this?
    I don’t have much php experience.

    jon-rookie wrote:
    > DreamerJim,
    >
    > I am sorry but I don't think you are correct. I just
    can't believe that with
    > all the powers to be at Macromedia and now Adobe can't
    figure out how to update
    > two tables at once. There are millions of db's out there
    that require this. I
    > spent several hours today perusing lots of posts on the
    internet. It seems I
    > am not the only one out there that has asked this
    question. Unfortunately
    > there are no good answers yet to my surprise.
    >
    > I did find a Dreamweaver extension that does exactly
    what I myself and many
    > others want. The problem is it is no longer available
    unless you purchase a
    > bundle of software from Adobe.
    >
    > I have not looked into it in detail so I am not 100%
    sure that is accurate!
    >
    > Still, alot of php programmers do this all the time
    without much trouble. I
    > just want to know if Dreamweaver mx 2004 has the
    capability if a person knows
    > the right steps.
    >
    > Hopefully a Dreamweaver expert will post something to
    let us know for sure.
    > Until then I am stuck.
    >
    Not even CS3 has this built in, you will either have to code
    it yourself
    or buy the extension you have found. Dreamweaver gives you
    basic
    features to help you develop applications, but if you want to
    do
    anything really clever you have to do it yourself.
    One thing to consider is maybe creating an SQL view that is
    can be
    updated. I am pretty sure it exists, then you use the view
    instead of
    the table in the update behaviour. I have never done it
    myself, but I am
    sure it can be done.
    Steve

  • Updating a table using cursor is taking long time in oracle

    Hi,
    I am working on the oracle database 11gR2. I am trying update a table column which is newly added through cursor. below is the cursor.
    BEGIN
         FOR lcur_tab IN (select l.LOGIN_ID as login_id, lt.ERROR_CODE as error_code from LOGIN l INNER JOIN LOGIN_TASK lt ON (l.LAST_LOGIN_TASK_ID = lt.LOGIN_TASK_ID) )
         LOOP
                   UPDATE ACCOUNT SET LOGIN_ERROR_CODE = lcur_tab.error_code where ACCOUNT_ID IN (SELECT ACCOUNT_ID FROM LOGIN_ACCOUNT where LOGIN_ID = lcur_tab.login_id ) ;
         end LOOP;
         commit;
    END;
    In the cursor we are trying to copy the Login table error_code value to LOGIN_ERROR_CODE of ACCOUNT Table, for the accounts associated with that Login. Here newly added column is LOGIN_ERROR_CODE in account table. this account table have 11million rows in it. when i used the above cursor it took 3hours and still running. So we stopped after that. Is there any way i can change this cursor syntax to update those column values. How can we do this type of updates?
    Also i am planning to run thus update in the background . I don't have much knowledge on the PL/SQL stuff. So please help on this.
    Thanks in advance.
    Edited by: Hari on Mar 21, 2012 10:06 PM

    Is there a reason that you don't want to do this with a single `UPDATE` statement? That should be quite a bit more efficient.
    Something like
    UPDATE account a
       SET login_error_code = (
          select lt.error_code
            from login_task lt
                 join login l on (l.last_login_task_id = lt.login_task_id)
                 join login_account la on (la.login_id = l.login_id)
           where la.account_id = a.account_id )
    WHERE EXISTS (
          select 1
            from login_task lt
                 join login l on (l.last_login_task_id = lt.login_task_id)
                 join login_account la on (la.login_id = l.login_id)
           where la.account_id = a.account_id );Justin

  • How to use one form to update two tables

    How can I do that? HTMLDB wizard or form on table doesn't give me an option to use more than one table in a form or I don't know about it. I created new process which redirects the form to another page after submitting the form. On the second page I created new process which uses the same variables from the previous form page. This process runs on page load before header but it is just not working right.
    So, what is the proper way to update two tables with the same form fields?

    Hello Vikas,
    "The Automatic Row Fetch and Automatic DML processes are a pair, you can't have one without the other."
    Are you sure about that? I have a page, which populate some of the items from TableA, using manual select statement, and after the user input, save some of it in TableB, using Automatic DML. No ARF in this process and it seems to work just fine. Come to think of it, what about a simple form, populated entirely by the user input, and then being saved to the db, using Automatic DML? No ARF here also.
    For the problem in hand, if you can't have more then one Automatic DML per page, I think that the simplest solution will be to define a pl/sql process, with two INSERT statement to the two different tables.
    Regards,
    Arie.

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • Updating a table using a custom OM infotype

    Hey gurus,
    I have created a custom OM infotype HRP9608. I wish to use this infotype to update a table.
    I marked it as an external, country specific infotype and blanked out the Database table from SM30 (table T777D)
    I have also blanked out the FM. for tab name using SM30 (table T77ID) and added in Read Function and Primary Table.
    The infotype gets created correctly, but when i add it as an external infotype the screen changes. Can someone please provide me with a solution.
    Thanks.

    Hi,
    See the given link, It may help you.
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=64259392
    Regards,
    Shamma

  • How to Update  crmd_customer_h TABLE Using CRMV_EVENT Through Funtion Module

    Hi
    How we can update customer_h table using the CRMV_EVENT Where i implemented logic below in the Funtion Module.
    data:     lt_doc_flow          TYPE crmt_doc_flow_wrkt,
              lw_cust_h_com        TYPE crmt_customer_h_com,
              lw_input_field_names TYPE crmt_input_field_names,
              lt_input_field_names TYPE crmt_input_field_names_tab,
              lt_objects_to_save TYPE crmt_object_guid_tab,
              lw_guid TYPE CRMT_OBJECT_GUID.
    DATA : lv_process_type TYPE crmt_process_type.
    data: wa_doc_flow type CRMT_DOC_FLOW_WRK.
    data: wa_customer_h type crmd_customer_h.
    *  Function module for retriving the Process type.
      CALL FUNCTION 'CRM_ORDERADM_H_READ_OW'
        EXPORTING
          iv_orderadm_h_guid     = iv_header_guid
        IMPORTING
          ev_process_type        = lv_process_type
        EXCEPTIONS
          admin_header_not_found = 1
          OTHERS                 = 2.
    if lv_process_type eq 'ZG01'.
    CALL FUNCTION 'CRM_DOC_FLOW_READ_OB'
    EXPORTING
       IV_HEADER_GUID                 = iv_header_guid
    IMPORTING
       ET_DOC_FLOW_WRK                = lt_doc_flow.
    read table lt_doc_flow with key objtype_a = 'BUS2000116' INTO wa_doc_flow. "gc_object_type-service.
                if sy-subrc eq 0.                    "set flag for service order
                lw_cust_h_com-ref_guid       =  wa_doc_flow-objkey_a.
                lw_cust_h_com-ZZTRAIL_FLAG   = 'X'.
                 lw_cust_h_com-mode           = 'A'.
                lw_cust_h_com-ref_handle     = '0000000001'.
                lw_guid = wa_doc_flow-objkey_a.
                INSERT lw_guid INTO TABLE lt_objects_to_save.
         endif.
                  lw_input_field_names-fieldname = 'REF_GUID'.
                lw_input_field_names-fieldname = 'ZZTRAIL_FLAG'.
              lw_input_field_names-changeable = ' '.
               INSERT lw_input_field_names INTO TABLE lt_input_field_names.
    Maintain Customer H
             CALL FUNCTION 'CRM_CUSTOMER_H_MAINTAIN_OW'
                  EXPORTING
                    is_customer_h_com    = lw_cust_h_com
                  CHANGING
                    ct_input_field_names = lt_input_field_names
                  EXCEPTIONS
                    header_change_error  = 1
                    header_create_error  = 2
                   error_occurred       = 3.
    ENDIF.
    *endif.
    *Clearing local variables
      clear: lv_process_type,
             lw_cust_h_com,
             lw_input_field_names.
    *Free internal tables
      free: lt_doc_flow,
            lt_input_field_names.

    Hi Faisal
    I think your not clear with what i am saying anyhow i will again explain you my requirement
    As per my requirement
    1)in the service order search report i need to add a field called "Has trail order with No Follow up" with values "Yes" & "Blank"
    For above Field i added  using the structure CRMST_QUERY_SRVO_BTIL and through configuration i am able to display the field in webui as per (Attachement Pic 1)
    2)When i  search with search criteria as  "Has trail order with No Follow up" with  "Yes"
    Then in result list i need to show the service order those having follow up as trail orders(sales order) only.if for  next document trail order  having any follow up then those service orders dont want to show in result list.
    For above requirement i implemented F.M using CRMV_EVENT & I configured for BUS2000115 And BEFORE_SAVE The Order
    The FM Will get trigger when i save the service order and for that service order if create any follow up and try to save the trail order then This FM Will trigger and in this i am doing validations.
    3)Add one AET Trail Flag field is added under CUSTOMER_H Table.
    4)in the FM I am validating for if the trail order having the preceding document as service order then i need to make flag as "X" For that service order in customer_h
    if suppose when i delete trail order from the service order then that flag must need to be "unset" from the CUSTOMER_H.
    Why bcoz we are doing above process is do show records in result list based on Flag values
    these flag checks are validating in the BADI Which we implemented for search logic.
    Please refer below Login for my requirement:-
    Proposal to have a custom “flag” field (background at table level,
         crmd_customer_h) linked to service order which gets flagged whenever at
         least one Trial order is created and saved from the Service Order.
    The flag value should be cleared when all the trial orders created and
    saved as follow up transactions are deleted from the system.
    Similarly for Trial Orders will use the same custom “flag” field
         which gets activated when at least one follow up is created and saved from Trial Order.
    The flag value should be cleared when all the follow up transactions from
    the Trial Order are deleted from the system.
    When the above search criteria “Has Trial order with no follow up”
         “is” “Yes” is applied then the logic derives all the service
         orders which satisfy additional search criteria applied in the search and
         for these Service orders checks if the custom flag field is checked to
         derive all Service orders which have Trial order. The custom flag values
         values are derived from crmd_customer_h table in CRM.
    4 )Further for all the Trial Orders determined in Step 3
    check if the Trial Order has a follow up by checking if the custom flag field
    is checked. The custom flag values are derived from crmd_customer_h table in
    CRM.
    5) If step 4 is not met populate the preceding Service
    Orders in the Result list

  • Updating a table from tabular form using a process

    Hi
    I have a tabular from creating using wizard
    I've a field called Last_updated_by in the table
    the username is assigned to an item P2_user based on the user who logs in.
    What I need is,when any row is updated, I need to update the last_updated column with value in p2_user.
    Need help on this
    I'm using apex 3.2 with 11g
    tried the below
    declare
    idx number:=1;
    begin
    FOR i in 1 .. wwv_flow.g_f01.COUNT
    LOOP
    for j in idx .. wwv_flow.g_f02.count
    loop
    update table_name set last_updated_by=:p2_user where ID=APEX_APPLICATION.G_F02(j);
    idx:=j+1;
    end loop;
    END LOOP;
    end;
    Its updating the table,but all the rows are getting updated,just not the selected rows.
    Not sure what I'm doing wrong here
    thanks
    Archana
    Edited by: Agowda on Jan 12, 2012 1:55 AM

    I am looking for the same... can you please share how did you got this working
    thanks

  • Updating lookup table using merge query

    Hi Experts,
    My requirement is, we have total 4 tables called x,y,z and a_lookup table. join column between all these tables is deptno.
    I need to update a_lookup table based on below conditions
       condition1 :   Update a_lookup table with matched records of X and Y
       condition2:    If there is any record in X is not matching with Y, then we need to compare with Z and update the a_lookup table accordingly
    Here is the table scripts and my attempt as well.
    Only doubt is,  is my MERGE statement looks fine or is there any other better way to update the a_lookup table ?
    Please share your thoughts on this.
    create table x(empno number, deptno number);
      -- sample data
      insert into x
        select level, level * 10 from dual connect by level <= 10;
      create table y(empno number, deptno number);
      -- sample data
      insert into y
        select level, level * 10 from dual connect by level <= 5;
      create table z(empno number, deptno number);
      -- sample data
      insert into z
        select level, level * 10 from dual connect by level <= 10;
      create table a_lookup(empno number, deptno_lookup number);
      -- sample data
      insert into a_lookup
        select null, level * 10 from dual connect by level <= 10;
      -- Merging records into a_lookup based on X,Y,Z. Used right outer join on X and Y
    merge into a_lookup a
    using ( (select  x.deptno,x.empno   from x,y where x.deptno=y.deptno)
               union all
               (select z.deptno,z.empno from z, (select x.deptno from x,y where x.deptno=y.deptno and y.deptno is null)  res1
                  where z.deptno = res1.deptno)
               ) res
    on( a.deptno_lookup = res.deptno)
    when matched then
      update set a.empno = res.empno;
    Cheers,
    Suri ;-)

    Assuming empno is unique in X, Y and Z:
    merge
      into a_lookup a
      using (
             select  nvl(y.empno,z.empno) empno,
                     x.deptno
               from  x,
                     y,
                     z
               where y.deptno(+) = x.deptno
                 and z.deptno(+) = x.deptno
            ) b
      on (
              a.deptno_lookup = b.deptno
          and
              b.empno is not null
      when matched
        then
          update
             set a.empno = b.empno
    10 rows merged.
    SCOTT@orcl > select * from a_lookup;
         EMPNO DEPTNO_LOOKUP
             1            10
             2            20
             3            30
             4            40
             5            50
             6            60
             7            70
             8            80
             9            90
            10           100
    10 rows selected.
    SCOTT@orcl >
    SY.

  • Updating a Table using Spreadsheet

    Hi,
    There are a couple tables that I would like to update regularly, like once every week. Instead of adding new rows, how can I update the tables by uploading CSV files using the Upload Utilities?
    Thank you very much for your help in advance!

    Here is an easier solution..
    1) Have you DBA create an Oracle directory on the server (it is created in Oracle and maps to a operating system directory.
    2) Create a external table in that directory, have it have the same layout as your spreadsheet
    3) Now when you build the external table, give it the name of the spreadsheet file
    4) You can then copy the file to the directory
    5) Write a small pl/sql script to select from the external table and do a merge of the data selected into the existing table (See merge command syntax here: http://www.oracle.com/technology/products/oracle9i/daily/Aug24.html)
    Thank you,
    Tony Miller
    Webster, TX

  • Update sap table using a function module call by php code

    Hello,
    I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE  call by a php code.
    But I have this problem:
    the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
    I tried the function module in debug mode and it work good. The fields are update.
    I also handle the saprfc call function and the return SAPRFC_OK
    This are the function module ZZ_SET_DISTANCE, and the php code
    //PHP CODE
    $fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
                  if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
                   saprfc_import ($fce,"COMMANDE", '0000001998');
                   saprfc_table_init($fce,"TBLE_CMDE");
                        $val=array();
                        $val['NUM_POST']='000030';
                        $val['HN_EXP']='';
                        $val['ST_EXP']='';
                        $val['PC_EXP']='';
                        $val['CI_EXP']='';
                        $val['CO_EXP']='';
                        $val['HN_REC']='';
                        $val['ST_REC']='';
                        $val['PC_REC']='';
                        $val['CI_REC']='';
                        $val['CO_REC']='';
                        $val['DIST']='popo';
                        saprfc_table_append ($fce,"TBLE_CMDE", $val);
                 $rfc_rc = saprfc_call_and_receive ($fce);
                 echo "\n".$rfc_rc;
                 if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
                 saprfc_function_free($fce);
    //FUNCTION MODULE ZZ_SET_DISTANCE
    FUNCTION ZZ_SET_DISTANCE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(COMMANDE) TYPE  VBELN
    *"  TABLES
    *"      TBLE_CMDE STRUCTURE  ZADD_COM_LOXAN
    DATA : NUMC TYPE VBELN.
    NUMC = COMMANDE .
    WHILE STRLEN( NUMC ) < 10 .
      CONCATENATE '0' NUMC INTO NUMC .
    ENDWHILE .
    DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
    LOOP AT  TBLE_CMDE INTO  tble_addrcomm.
      DATA : NUMP TYPE POSNR.
      NUMP = tble_addrcomm-NUM_POST.
      WHILE STRLEN( NUMP ) < 6 .
      CONCATENATE '0' NUMP INTO NUMP .
      ENDWHILE .
      UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
      WHERE VBELN EQ COMMANDE
      AND POSNR EQ NUMP.
    ENDLOOP.
    ENDFUNCTION.
    Is anybody can help me?
    thank.

    Marie, create a Blog please, about more details for dummies....
    1) how to connect to sap system?
    2) you run the php code where? in a webserver or where?
    3) wich is the url for run the FM: ZZ_SET_DISTANCE
    4) you placed some dlls files on the web server?
    please is interesting this...
    Thanks

  • Code to update a table using sqlldr

    Hi all,
    can anybody give the code to update a table using sqlldr with an example
    thank you

    You want add the new line and modified the existing line (based on empno) from file e:\scripts\sql\emp2_ext.dat into table emp2 :
    7782,CLARK,MANAGER,7839,09/06/81,80000,,10
    8000,ORACLE,DATABASE,,11/02/07,99999,,20Then :
    SQL> conn system/mypwd
    Connected.
    SQL>
    SQL> create directory my_dir as 'e:\scripts\sql';
    Directory created.
    SQL>
    SQL> grant read,write on directory my_dir to scott;
    Grant succeeded.
    SQL>
    SQL> conn scott/mypwd
    Connected.
    SQL> create table emp2_ext
      2  (EMPNO    NUMBER(4),
      3   ENAME    VARCHAR2(10),
      4   JOB      VARCHAR2(9),
      5   MGR      NUMBER(4),
      6   HIREDATE DATE,
      7   SAL      NUMBER(7,2),
      8   COMM     NUMBER(7,2),
      9   DEPTNO   NUMBER(2)
    10  )     
    11  ORGANIZATION EXTERNAL
    12  ( TYPE ORACLE_LOADER
    13    DEFAULT DIRECTORY my_dir
    14    ACCESS PARAMETERS
    15    ( records delimited by newline
    16      badfile my_dir:'emp2_ext.bad'
    17      logfile my_dir:'emp2_ext.log'
    18      fields terminated by ','
    19      missing field values are null
    20      ( empno, ename, job, mgr, hiredate char date_format date mask "dd/mm/yy",
    21        sal, comm, deptno
    22      )
    23    ) LOCATION ('emp2_ext.dat')
    24  ) ;
    Table created.
    SQL>
    SQL> select * from emp2_ext;
         EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09/06/81      80000                    10
          8000 ORACLE     DATABASE             11/02/07      99999                    20
    SQL> select * from emp2;
         EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09/06/81      24500                    10
          7839 KING       PRESIDENT            17/11/81      50000                    10
          7934 MILLER     CLERK           7782 23/01/82      13000                    10
    SQL> merge into emp2 a
      2  using (select * from emp2_ext) b
      3  on    (a.empno=b.empno)
      4  when matched then update set a.ename=b.ename,
      5                               a.job=b.job,
      6                               a.mgr=b.mgr,
      7                               a.hiredate=b.hiredate,
      8                               a.sal=b.sal,
      9                               a.comm=b.comm,
    10                               a.deptno=b.deptno
    11  when not matched then insert (a.empno, a.ename, a.job, a.mgr, a.hiredate, a.sal, a.comm, a.deptno)
    12                        values (b.empno, b.ename, b.job, b.mgr, b.hiredate, b.sal, b.comm, b.deptno);
    2 rows merged.
    SQL>
    SQL> select * from emp2;
         EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09/06/81      80000                    10 --modified line
          7839 KING       PRESIDENT            17/11/81      50000                    10
          7934 MILLER     CLERK           7782 23/01/82      13000                    10
          8000 ORACLE     DATABASE             11/02/07      99999                    20 --added line
    SQL> HTH,
    Nicolas.
    Well, Hans has already give good explanation with docs links...
    Message was edited by:
    N. Gasparotto

Maybe you are looking for

  • Customer and supplier linkage

    Hi Friends, There is a requirement where my client has customer , later point of time they are also Suppliers, they want a report(Consolidated report) which can fetch both Customers and Suppliers transactions and key thing is they dont want to net of

  • How to center align Alert.show() in flex

    Hello All, I have a tall Flex application that uses Alert.show( ) to display error/warning messages. This created problems when the error messages were centered on the screen, but not visible when the screen was at an extreme scroll position (top or

  • IPad, iCal, and subscriptions

    Hey guys, I've been having trouble with my subscriptions syncing to my devices. I have three (supposedly) synced up, including Australian Holidays, Local Weather, and most importantly and whats brought me here, Facebook. The only subscribed calendar

  • Need to start a process in windows from a process in solaris os

    Hi All, I am new to Solaris OS. I need to spawn a process existing(Not currently running) in windows 2000 SP4 proffessional edition from a process currently running in Solaris OS. Can any one let me know, what would be the best way to do this. I am u

  • HT3702 I have forgot my security qwestion end cant youse my recover  email how can i buy things now ?

    I have forgot my security qwestions end i cant youse my recover email what do i need to do ?