750K Updates Daily to a 70 million table

We have a pretty wide table with 50 + columns (varChar and other) that needs updating daily.
Around 250K inserts and 750K updates. Inserts are not a problem.
The ETL process doing the updates currently is very slow and I would like some ideas as to how to go about improving the performance of this load.
Adding more info:
Since, this is via an ETL process--it is doing row by row updates. I do not have an explain plan.
Database is Oracle 11g 64bit
The dimension table has 25 indexes including an index on the column I am basing the update on.
There is no partitioning on the table at this time.
I was looking for suggestions --maybe to speed up the update by using a temporary table or something. I have read about CTAS but am not sure whether that is applicable here considering there are only 750K updates.
Edited by: zebango on Mar 20, 2012 9:20 AM

zebango wrote:
We have a pretty wide table with 50 + columns (varChar and other) that needs updating daily.
Around 250K inserts and 750K updates. Inserts are not a problem.
The ETL process doing the updates currently is very slow and I would like some ideas as to how to go about improving the performance of this load.
Adding more info:
Since, this is via an ETL process--it is doing row by row updates. I do not have an explain plan.
Database is Oracle 11g 64bit
The dimension table has 25 indexes including an index on the column I am basing the update on.
There is no partitioning on the table at this time.
I was looking for suggestions --maybe to speed up the update by using a temporary table or something. I have read about CTAS but am not sure whether that is applicable here considering there are only 750K updates.
since the amount of data update is high i would go by following method to increase the performance:
Suppose you want to update EMP table with LOWER(ename), then
1) create table new_emp as select empno, LOWER(ename) ename, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO from emp;
2) drop table emp;
3) rename new_emp to emp;
Now in step 1) i could also have used /*+ full parallel(tablename, 10) */ to increase performance further, but this depends upon the cpus.
Second option would be
Drop indexes, constraints before update and rebuild in parallel once update is done...
Third option would be
Use parallel DML
Fourth option would be
Adjust PCTFREE and PCTUSED parameters to increase performance of update
Have a look at
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6407993912330

Similar Messages

  • How To Perform Parallel UPDATE When Trigger is ENABLE On Table.

    select *from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionIs there any way to perform PARALLEL UPATE on a table which has a trigger?
    One of my ETL performs a large UPDATE (14 Million update) everyday on a production hot table. Eventhough PDML is enable at session level (also TABLE.DEGREE=8), Oracle is doing serialized UPDATE.
    As per Oracle documents, it is documented behavior.
    Here is my Execution plan when i put the trigger ENABLE
    | Id  | Operation              | Name                | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | UPDATE STATEMENT       |                     |       |       |  6443 (100)|          |       |       |        |      |            |
    |   1 |  UPDATE                | ACCOUNT             |       |       |            |          |       |       |        |      |            |
    |*  2 |   PX COORDINATOR       |                     |       |       |            |          |       |       |        |      |            |
    |   3 |    PX SEND QC (RANDOM) | :TQ10000            | 72487 |  3610K|  6443   (3)| 00:01:18 |       |       |  Q1,00 | P->S | QC (RAND)  |
    |*  4 |     FILTER             |                     |       |       |            |          |       |       |  Q1,00 | PCWC |            |
    |   5 |      PX BLOCK ITERATOR |                     | 72487 |  3610K|  6443   (3)| 00:01:18 |   KEY |   KEY |  Q1,00 | PCWC |            |
    |*  6 |       TABLE ACCESS FULL| ACCOUNT             | 72487 |  3610K|  6443   (3)| 00:01:18 |   KEY |   KEY |  Q1,00 | PCWP |            |
    Predicate Information (identified by operation id):
         8 - filter("SET_OF_BOOKS"='1' AND "GL_BATCH_ID">(-10) AND ("JOURNAL_ENTRY_TYPE_ID"<2400 OR
                  "JOURNAL_ENTRY_TYPE_ID">=3000) AND "ACCOUNTING_DATE">=TO_DATE(' 2010-08-11 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "ACCOUNTING_DATE"<TO_DATE(' 2010-08-12 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))When i disable trigger
    | Id  | Operation                | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | UPDATE STATEMENT         |          |   726 | 27588 | 11899   (2)| 00:02:23 |        |      |            |
    |   1 |  PX COORDINATOR          |          |       |       |            |          |        |      |            |
    |   2 |   PX SEND QC (RANDOM)    | :TQ10001 |   726 | 27588 | 11899   (2)| 00:02:23 |  Q1,01 | P->S | QC (RAND)  |
    |   3 |    INDEX MAINTENANCE     | ACCOUNT  |       |       |            |          |  Q1,01 | PCWP |            |
    |   4 |     PX RECEIVE           |          |   726 | 27588 | 11899   (2)| 00:02:23 |  Q1,01 | PCWP |            |
    |   5 |      PX SEND RANGE       | :TQ10000 |   726 | 27588 | 11899   (2)| 00:02:23 |  Q1,00 | P->P | RANGE      |
    |   6 |       UPDATE             | ACCOUNT  |       |       |            |          |  Q1,00 | PCWP |            |
    |   7 |        PX BLOCK ITERATOR |          |   726 | 27588 | 11899   (2)| 00:02:23 |  Q1,00 | PCWC |            |
    |*  8 |         TABLE ACCESS FULL| ACCOUNT  |   726 | 27588 | 11899   (2)| 00:02:23 |  Q1,00 | PCWP |            |
    Predicate Information (identified by operation id):
       8 - filter("SET_OF_BOOKS"='1' AND "GL_BATCH_ID">(-10) AND ("JOURNAL_ENTRY_TYPE_ID"<2400 OR
                  "JOURNAL_ENTRY_TYPE_ID">=3000) AND "ACCOUNTING_DATE">=TO_DATE(' 2010-08-11 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "ACCOUNTING_DATE"<TO_DATE(' 2010-08-12 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))I cannot disable trigger due to some business reasons.
    Is there any way to speed up UPDATE ?

    No, you cannot perform parallel dml with a trigger present.
    If you are updating the bulk of the rows and can take an outage, you can
    disable the trigger, perform the update, enable the trigger
    OR
    copy to another table, performing the update in the select, rename the tables and add the trigger on the new table
    Hemant K Chitale

  • How to tcack the table update event in sap for all tables by use of single

    Hello,
         I want to store the list of all OM,HR tables in a file which are updated after perticular date. For that i tried TRIGGER but i can write only one trigger for one table, i want such a that  i have to write only one trigger which will be invoked affter update operation on every HR,OM tables and i store information in a file  regarding which rows are updated and external application can use it.
    Thanks in advance,     
    SANDIP

    hi all the log for the change of any thing will be available in the tables DBTABLOG..REPOSRC ....
    regards,
    venkat.

  • How can i update data in okc_k_items and csi_item_instances tables?

    How can i update data in okc_k_items and csi_item_instances tables?
    by EBS .
    Thanks.

    For csi_item_instances table, you can use the following API:
    CSI_ITEM_INSTANCE_PUB.UPDATE_ITEM_INSTANCE
    For okc_k_items, try using the following API:
    OKC_CONTRACT_ITEM_PUB.UPDATE_CONTRACT_ITEM
    Hope this helps!

  • Updation of Custom Fields in AFRU table Using Customerexit

    Hi all,
    I added two fields in CO11n Tcode using SCREEN EXIT - CONFPP07 and iam trying to update these two fields in AFRU table
    using CONFPP05.  But iam unable to update these two field .
    see this code in CONFPP05
      LOOP AT afrud_tab.
        afrud_tab-zzshift = wa_afrud-zzshift1 .
        afrud_tab-zzoperator = wa_afrud-zzoperator1 .
        MODIFY afrud_tab.
      ENDLOOP.
    Plz help me regarding this..

    Thanks for reply
    Ya i added two fields in confpp07 .
    see the code :
    *&  Include           ZXCOFTOP
    tables : afrud.
    DATA : WA_AFRUD TYPE AFRUD,
            IT_AFRUD TYPE TABLE OF AFRUD.
    Include           ZXCOFU24
    MOVE afrud-zzshift1 TO wa_afrud-zzshift1.
    MOVE afrud-zzoperator1 TO wa_afrud-zzoperator1.
    Even though it is not updating . except these two fields.
    Regards,
    Srinivas

  • How to find out who made inserts/updates/deletes made to a SQL Table

    I want to know WHO MAKES INSERTS/UPDATES/DELETES TO a particular SQL Table. Bascially I want to AUDIT ANY Edites made to a SQL 2008 TABLE. I need info such as WHO AMDE THE Updates i.e. the user first/lastname, When update was made, what row was updated etc...How
    can I do that with SQL 2008?

    One way to achieve that would be to use triggers to detect when a change is made to the table, and then insert a record into another table/database detailing what changed and who by.
    You'd need three triggers, one for insert, update and delete respectively, and for each of those you use the "inserted" and "deleted" tables (system tables maintained by SQL) to retrieve what has been done. To retrieve who made the change you can query IDENT_CURRENT
    which returns the last identity value for a specific table.
    See :
    Triggers -
    http://msdn.microsoft.com/en-gb/library/ms189799(v=sql.100).aspx
    Inserted & deleted tables -
    http://technet.microsoft.com/en-us/library/ms191300(v=sql.100).aspx
    INDENT_CURRENT -
    http://technet.microsoft.com/en-us/library/ms175098(v=sql.100).aspx
    There may be better / more up to date ways to do this, but I've used this method successfully in the past, albeit a long time ago (on a SQL 2000 box I think!).

  • Update the correct profit center in tables BSEG / BSAS / BSIS / BSIK / BSAK

    Hi FI Gurus,
    I am looking after a Support Project in SAP IS-Retail. I am from the FI functional and possess very limited knowledge in FI.
    My client has done the sales posting in SAP using IDOC's. During the postings, it was found that wrong Profit Centers were assigned. Due to this, the sales reports based on Profit Center are coming wrong. It was suggested to the client to reverse the IDOCs, do necessary changes in Profit Centers and re-post the IDOCs. The client wanted a short method to get the reports right. A senior consultant (Non FI) in the Company and the Management are forcing me to write a ABAP program to update certain (not all) FI tables. According to me, it will have some negative impact on the system for which reason I am not ready to take the call as a Project Manager. The management wants me to do the following (I am quoting the same mail which I received from the consultant ) :
    We need to update the correct profit center in tables BSEG / BSAS / BSIS / BSIK / BSAK / BSID / BSAD, wherever the records exists against billing document numbers provided.
    BAPI for updating profit center in Accounting documents: BAPI_ACC_DOCUMENT_POST
    Function Module : 'BAPI_DOCUMENT_CHANGE'
    Also look at SAP Note: Note 966428 - FB02: Functional area (FKBER) can be changed on coding block
    Based on the above, the ABAPer has written the program, the program will update the tables BSEG, BSIS, BSIK, according to the selection criteria of document number, company code and line item number with the new profit centers.
    Please clarify me about the following :
    1. This program is updating profit center in just the FI tables (BSEG, BSIS, BSIK etc.), but the New GL tables (faglflexa and faglflext) which have approx. 65 lakh entries in PRD do not get updated with the correct profit center.
    2. The Controlling tables also do not get updated with this program yet. Also since the previoius updation of Profit centers did not happen correctly, most of the times the controlling document has not been generated at all. Since we will be updating the profit center in just the FI tables, the controlling document will not be created still. Though there are SAP notes suggesting re-creation of the Controlling documents, which is still an option you can choose. Please confirm.
    3. The Special GL also does not get updated because of this.
    This is a very critical and hot issue. My job is at Stake as the Management has threatened me of sacking if I do not follow their directives as they are only concerned with their money.
    Is the consultant who suggested this change RIGHT ?
    Your early replies will help me take the decision.
    Regards

    Hi,
    There is no standard program or BAPI that would update profit centre in a posted document. You should either develop your own process for it,which is not recommended, but sometimes is essential, or reverse the existing documents and post them with the correct profit centre.
    Regards,
    Eli

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • Trigger in mutation - Update another rows in the same table with a trigger

    Hi ,
    I try to do a before update trigger on a table , but the trigger is in mutation. I understand why it do that but my question is :
    How can I update other rows in the same table when a UPDATE is made on my table??????
    Here is my trigger :
    CREATE OR REPLACE TRIGGER GDE_COMPS_BRU_5 BEFORE
    UPDATE OF DEPARTEMENT--, DISCIPLINE, DEG_DEMANDE, CE_ETAB
    ON GDEM.COMPOSITION_SUBV
    FOR EACH ROW
    Organisme : FQRNT-FQRSC
    Date de création : 14-07-2011
    Date de modification :
    Modifié par :
    Auteur : Johanne Plamondon
    Description : Ce déclencheur s'executera lors de la modification
    du responsable dans la table COMPOSITION_SUBV
    DECLARE
    V_OSUSER V$SESSION.OSUSER%TYPE;
    V_PROGRAM V$SESSION.PROGRAM%TYPE;
    V_TERMINAL V$SESSION.TERMINAL%TYPE;
    V_MACHINE V$SESSION.MACHINE%TYPE;
    V_MODULE V$SESSION.MODULE%TYPE;
    V_LOGON_TIME V$SESSION.LOGON_TIME%TYPE;
    V_AUDIT_ID NUMBER;
    vSEQ NUMBER;
    i NUMBER;
    vID DEMANDE.ID%TYPE;
    BEGIN
    begin
    SELECT OSUSER, PROGRAM, TERMINAL,MACHINE,MODULE, LOGON_TIME
    INTO V_OSUSER,V_PROGRAM,V_TERMINAL,V_MACHINE,
    V_MODULE,V_LOGON_TIME
    FROM V$SESSION
    WHERE TYPE = 'USER'
    AND USERNAME = USER
    AND LAST_CALL_ET IN (0,1)
    AND ROWNUM < 2;
    exception when others then null; end;
    IF NVL(:NEW.SC_PART,' ') = 'CHC' THEN
    SELECT COUNT(*)
    INTO i
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    IF i = 1 THEN
    SELECT ID
    INTO vID
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    UPDATE COMPOSITION_SUBV
    SET --CE_ETAB     = :NEW.CE_ETAB,
    --DISCIPLINE  = :NEW.DISCIPLINE,
    DEPARTEMENT = :NEW.DEPARTEMENT,
    --DEG_DEMANDE = :NEW.DEG_DEMANDE,
    DATE_MODIF = SYSDATE,
    USER_MODIF = V_OSUSER
    WHERE DEM_ID = vID
    AND PER_NIP = :NEW.PER_NIP
    AND ANNEE = :NEW.ANNEE;
    END IF;
    END IF;
    /*EXCEPTION
    WHEN OTHERS THEN
    NULL;*/
    END;

    A standard disclaimer, the mutating trigger error is telling you that you really, really, really don't want to be doing this. It generally indicates a major data model problem when you find yourself in a situation where the data in one row of a table depends on the data in another row of that same table. In the vast majority of cases, you're far better off fixing the data model than in working around the problem.
    If you are absolutely sure that you cannot fix the data model and must work around the problem, you'll need
    - A package with a collection (or global temporary table) to store the keys that are modified
    - A before statement trigger that initializes the collection
    - A row-level trigger that adds the keys that were updated to the collection
    - An after statement trigger that iterates over the data in the collection and updates whatever rows need to be updated.
    If you're on 11g, this can be simplified somewhat by using a compound trigger with separate before statement, row-level, and after statement sections.
    Obviously, though, this is a substantial increase in complexity over the single trigger you have here. That's one of the reasons that it's generally a bad idea to work around mutating table exceptions.
    Justin

  • How to delete or Update the data in the MEAN table

    Hello Gurus,
    I would like to delete or update the data in the MEAN table...how to do it.
    Precisely I would like to change the status of Main EAN Indicator (field HPEAN).
    Kindly let me know ??
    Rehards
    Senthilll

    programmatically, you may use [BAPI_MATERIAL_SAVEDATA|https://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata&cat=sdn_all] [EAN|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bapi_material_savedata+ean&adv=false&sortby=cm_rnd_rankvalue]
    Regards,
    Raymond

  • Updating Purchase Order data in VBKD table

    Hello,
    We are trying to update Purchase order data in VBKD table for Sales Order at Item level. When sales Order is created, VBKD has a default record with VBELN = 'sales order number' and Item = '00000'. We want to update BSTKD_E field with Purchase order number for VBELN= 'sales order number' and Item = '00010'.
    We wrote our logic in USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_MOVE_FIELDS_TO_VBKD in MV50AFZZ to append new entries in XVBKD with VBELN= 'sales order number' and Item = '00010'. But in this case Sales order is not created with UPDATE TERMINATED message. We are not sure if we can append a new record in XVBKD.
            wa_xvbkd = xvbkd.
            wa_xvbkd-posnr = wa_xvbap-posnr.  "00010
            wa_xvbkd-bstkd_e = vbkd-bstkd.   "PO no
            wa_xvbkd-posex_e = wa_xvbap-posnr. "Purch. order item no
            wa_xvbkd-updkz = C_I.
            APPEND wa_xvbkd TO xvbkd.
            CLEAR wa_xvbkd.
    Please advice the suitable way to have a Purchase Order item level data in Sales Order.
    Thanks
    Rohit

    Hi,
    You can try these FM to update info record.
    ME_DB_UPDATE_INFORECORDS
    ME_UPDATE_INFORECORD
    ME_UPDATE_INFORECORD_COND
    ME_UPDATE_INFORECORD_PD
    Check the sample code on BAPI_PO_CHANGE
    http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
    Regards,
    Shiva Kumar

  • In xp reader version 9.3.2 updates daily. how do I stop this auto update daily?

    version 9.3.2 updates daily. how do I stop this auto update daily?

    Will do.  In the meantime, try this link for an online chat: www.adobe.com/go/chatcs.  Only waited for a minute or two for a tech support person.  Good Luck.

  • Update the data in user-defined table

    Dear All,
    Is there anyway we can insert / update the data in user-defined table in a batch instead of update it from the interface one by one? Our customer has 1,000+ data need to be imported.
    They are on SAP2007A SP00 PL45, SQL 2005, CA localization. Thanks a lot.
    Regards,
    yuka

    Dear Yuka,
    If it is UDT, you may use any SQL query to insert, update it. It is not under SAP support anyway.
    Thanks,
    Gordon

  • Updating an existing data  in the table...urgent

    Hi All,
    I am updating the existing records in the table.My CO piece of code is as below:
    if(!vo.isExecuted() && !vo.isPreparedForExecution())
    vo.executeQuery();
    Row requestRow = vo.getCurrentRow();
    requestRow.setAttribute("CustomerName", custName);
    requestRow.setAttribute("CustomerNumber", custNumber);
    but I am getting Null pointer exception at line:
    vo.getCurrentRow();
    Its very urgent.
    Please help me on this.
    Akshata
    Edited by: Akshata on Apr 25, 2012 3:29 AM

    Try below
    if(!vo.isExecuted() && !vo.isPreparedForExecution())
    vo.executeQuery();
    Row requestRow = vo.first(); //If it also returns null, that means the VO doen't have any rows.
    requestRow.setAttribute("CustomerName", custName);
    requestRow.setAttribute("CustomerNumber", custNumber);
    Regards,
    Peddi.

  • Can I upload an image using an URL for an image already on the web? (I want to do this because the image I am trying to reference updates daily)

    I am using a PC with windows 7. I have a number of figures that update daily as data is automatically download that I would like to build a page to display. I am hoping that by uploading an image using the URL it will update when the image updates at that URL. I am not sure if this is possible.
    -Max

    You need to use a jpeg image or a PNG image. Use GraphicConverter 7.3 to change the format.

Maybe you are looking for

  • I put the CD or DVD in my iMac it stay for a while then it comes back out help please

    I put the CD or DVD in my iMac it stay for a while then it comes back out help please

  • Java.lang.NullPointerException with OracleXMLParser V2

    Hi, I am getting java.lang.NullPointerException with OracleXMLParser V2. Following is some of the code snippet. I am not sure where I am going wrong. I am using the SAXParser. I tried both FileReader as well as URL InputSources But I am getting the s

  • JNDI Lookup hangs with AppServer 8

    Hi, I created a simple SessionBean on Sun One AppServer 8. I wrote a standalone application that you can find below. What is does is in a loop, create an initial context and lookup the EJB. The problem is that after a few iterations, it hangs. I real

  • IPhoto not playing video

    I uploaded videos and pictures taken from my wife's iPhone 5 into iPhoto.  We normally upload everything into Aperture on the iMac; however that computer is being repaired right now.  So, we uploaded the videos onto her MacBook Pro and into iPhoto (b

  • 975x PUE random reboots during games

    Here is my setup: MSI 975x PUE Core 2 Duo E6300 2GB Gskill 800mhz DDR2 X1900XTX  (PCI-e) 300GB HDD Xfi Fatality Windows XP And Vista My system seems to reboot randomly when playing games.  No warning, No errors, just straight reboot.  It could be 5 m