Mutating error in different situations....

Hi All
I am getting mutating error in the following situtations.......please provide the suitable solution
1) Update same table on which trigger has been written
e.g. written trigger on abc table in which
command
update abc set col_nm=’New Name’
where col_id=
2) In trigger block called some procedure.
In procedure again update same table.
e.g. written trigger on abc table
it calls proc1 procedure.
In proc1 procedure it again update abc table
3)Select same table in same trigger e.g.
Written trigger on abc table and in that again query for selecting data.
Select sum(col_1) from abc
4)In trigger block called some procedure.
In procedure again select same table.
e.g. written trigger on abc table
it calls proc1 procedure.
In proc1 procedure it again select sum(col_1) from abc
5) In trigger block called some procedure in procedure update
another table which has a trigger in this trigger there is update or select query
for same table
e.g written trigger on abc table it calls procedure proc1 in proc1 it is updating some other table
xyz which has a update trigger in this update trigger it has updating and selecting data from
table abc.

http://asktom.oracle.com/tkyte/Mutate/index.html

Similar Messages

  • Ditafm-output.ini and PDF output for different situations

    I'm using a DITA 1.2 structured app and templates that I've set up. I'm generally happy with the output that I'm getting now, but I've also come to realize that I have two different situations for PDF output--in situation one, I need to set up for printed books, i.e., facing pages, keeping chapters starting on right-hand pages and so on. Situation two is for electronically-distributed PDFs that are NOT books--files that customers might print themselves, probably not double-sided, so I don't need facing pages with the associated blank pages in the file, and so on.
    I'm using flags in the ditafm-output.ini file to control the pagination for the printed book in my output. Both situations currently use the same output templates, though I may create a single-sided template for situation two. That's easy enough.
    My question, then, is this: It seems to me that I'll need two different ditafm-output.ini files for the two situations. Is there an easy way to switch between them? Output seems separate from the structured application, and I don't need or want two separate apps.
    The best I can think of at the moment is to create a second ditafm-output.ini file with the settings I want for situation two, name it ditafm-output_foo.ini and change it to the "real" name when I need it. This, of course, introduces a potential overwrite disaster. Naturally, I'll keep backups.
    Unless there's a better way??

    That's the only way I can think of using "default" Frame to support multiple output types. To make it less error-prone you might set up batch files that do the copying .. just run the right batch file before you build each type of book.
    OR .. you could use DITA-FMx which lets you define an INI file for each book-build (and provides many more features).
         http://leximation.com/dita-fmx/
    Cheers,
    Scott Prentice
    Leximation, Inc.
    www.leximation.com

  • Ever thought of making an Ad in which all Apple Products(or at least the greatest 1s) are being used by a person in his or her day in different situations ?...those products in 1 ad ?

    Was just thinking a few days ago...Apple never made an ad in which all their products or at least some of their most renowned products are being used by 1 person in a day in different situations he faces...from using an iPod for jogging n then the guy just goes back home sits on his iMac then goes somewhere with his iPad then attending an important call from his iPhone n wanting to watch a movie from his Apple TV or doing something with Macbook Air or Macbook Pro....just a thought

    You're only addressing other users here - you might want to try feedback:
    http://www.apple.com/feedback/

  • [svn] 3519: Fix typo in error string for situations where there are advanced messaging configuration settings from LCDS used in the configuration files but no AdvancedMessagingSupport service .

    Revision: 3519
    Author: [email protected]
    Date: 2008-10-08 04:17:40 -0700 (Wed, 08 Oct 2008)
    Log Message:
    Fix typo in error string for situations where there are advanced messaging configuration settings from LCDS used in the configuration files but no AdvancedMessagingSupport service. The error string said that there was no flex.messaging.services.AdvancedMessagingService registered but it is the flex.messaging.services.AdvancedMessagingSupport service that needs to be registered.
    Add configuration test that starts the server with a destination that has the reliable property set which is an advanced messaging feature but there is no AdvancedMessagingSupport service registered.
    Modified Paths:
    blazeds/trunk/modules/common/src/flex/messaging/errors.properties
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/error.txt
    blazeds/trunk/qa/apps/qa-regress/testsuites/config/tests/messagingService/ReliableDestina tionWithNoAdvancedMessagingSupport/services-config.xml

    Hi,
    Unfortunately I already tried all kinds of re-installs (the full list is in my original message). The only one remaining is the reinstall of Windows 8 itself, which I would really like to avoid.
    What I find really strange is the time it takes for the above error message to appear. It's like one hour or even more (never measured exactly, I left the computer running).
    What kind of a timeout is that? I would expect that, if ports are really used by some other application, I get the message in less than a minute (seconds, actually). To me this looks like the emulator itself for some reason believes there's a problem with
    some port while in reality there isn't.
    I'll eventually contact Microsoft Support, thanks for the suggestion.

  • How to avoid mutating error when insert or update record

    Hi ,
    I have one transaction table which is having some detail record under one transaction number, after the one transaction number is over by insert or update, i
    want to check the total amounts of one flag should be matched on same table if it is not then give error message. But i am getting mutating error on insert or update event trigger on statement level trigger on above table.
    Is there any other way to avoid mutating error to solve the above problem or some temp table concepts to be used. help me its urgent.
    Thanks in advance,
    Sachin Khaladkar
    Pune

    Sachin, here's as short of an example as I could come up with on the fly. The sample data is ficticious and for example only.
    Let's say I need to keep a table of items by category and my business rule states that the items in the table within each category must total to 100% at all times. So I want to insert rows and then make sure any category added sums to 100% or I will rollback the transation. I can't sum the rows in a row-level trigger because I'd have to query the table and it is mutating (in the middle of being changed by a transaction). Even if I could query it while it is mutating, there may be multiple rows in a category with not all yet inserted, so checking the sum after each row is not useful.
    So here I will create;
    1. the item table
    2. a package to hold my record collection (associative array) for the trigger code (the category is used as a key to the array; if I insert 3 rows for a given category, I only need to sum that category once, right?
    3. a before statement trigger to initialize the record collection (since package variables hang around for the entire database session, I need to clear the array before the start of every DML (INSERT in this case) statement against the item table)
    4. a before row trigger to collect categories being inserted
    5. an after statement trigger to validate my business rule
    I then insert some sample data so you can see how it works. Let me know if you have any questions about this.
    SQL> CREATE TABLE item_t
      2   (category  NUMBER(2)   NOT NULL
      3   ,item_code VARCHAR2(2) NOT NULL
      4   ,pct       NUMBER(3,2) NOT NULL);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE trg_pkg IS
      2    TYPE t_item_typ IS TABLE OF item_t.category%TYPE
      3      INDEX BY PLS_INTEGER;
      4    t_item       t_item_typ;
      5    t_empty_item t_item_typ;
      6  END trg_pkg;
      7  /
    Package created.
    SQL> SHOW ERRORS;
    No errors.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER item_bs_trg
      2    BEFORE INSERT
      3    ON item_t
      4  BEGIN
      5    DBMS_OUTPUT.put_line('Initializing...');
      6    trg_pkg.t_item := trg_pkg.t_empty_item;
      7  END item_bs_trg;
      8  /
    Trigger created.
    SQL> SHOW ERRORS;
    No errors.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER item_br_trg
      2    BEFORE INSERT
      3    ON item_t
      4    FOR EACH ROW
      5  BEGIN
      6    trg_pkg.t_item(:NEW.category) := :NEW.category;
      7    DBMS_OUTPUT.put_line('Inserted Item for Category: '||:NEW.category);
      8  END item_br_trg;
      9  /
    Trigger created.
    SQL> SHOW ERRORS;
    No errors.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER item_as_trg
      2    AFTER INSERT
      3    ON item_t
      4  DECLARE
      5    CURSOR c_item (cp_category item_t.category%TYPE) IS
      6      SELECT SUM(pct) pct
      7        FROM item_t
      8       WHERE category = cp_category;
      9  BEGIN
    10    DBMS_OUTPUT.put_line('Verifying...');
    11    FOR i IN trg_pkg.t_item.FIRST..trg_pkg.t_item.LAST LOOP
    12      DBMS_OUTPUT.put_line('Checking Category: '||trg_pkg.t_item(i));
    13      FOR rec IN c_item(trg_pkg.t_item(i)) LOOP
    14        IF rec.pct != 1 THEN
    15          RAISE_APPLICATION_ERROR(-20001,'Category '||trg_pkg.t_item(i)||' total = '||rec.pct);
    16        END IF;
    17      END LOOP;
    18    END LOOP;
    19  END item_as_trg;
    20  /
    Trigger created.
    SQL> SHOW ERRORS;
    No errors.
    SQL> INSERT INTO item_t
      2    SELECT 1, 'AA', .3 FROM DUAL
      3    UNION ALL
      4    SELECT 2, 'AB', .6 FROM DUAL
      5    UNION ALL
      6    SELECT 1, 'AC', .2 FROM DUAL
      7    UNION ALL
      8    SELECT 3, 'AA',  1 FROM DUAL
      9    UNION ALL
    10    SELECT 1, 'AA', .5 FROM DUAL
    11    UNION ALL
    12    SELECT 2, 'AB', .4 FROM DUAL;
    Initializing...
    Inserted Item for Category: 1
    Inserted Item for Category: 2
    Inserted Item for Category: 1
    Inserted Item for Category: 3
    Inserted Item for Category: 1
    Inserted Item for Category: 2
    Verifying...
    Checking Category: 1
    Checking Category: 2
    Checking Category: 3
    6 rows created.
    SQL>
    SQL> SELECT * FROM item_t ORDER BY category, item_code, pct;
      CATEGORY IT        PCT
             1 AA         .3
             1 AA         .5
             1 AC         .2
             2 AB         .4
             2 AB         .6
             3 AA          1
    6 rows selected.
    SQL>
    SQL> INSERT INTO item_t
      2    SELECT 4, 'AB', .5 FROM DUAL
      3    UNION ALL
      4    SELECT 5, 'AC', .2 FROM DUAL
      5    UNION ALL
      6    SELECT 5, 'AA', .5 FROM DUAL
      7    UNION ALL
      8    SELECT 4, 'AB', .5 FROM DUAL
      9    UNION ALL
    10    SELECT 4, 'AC', .4 FROM DUAL;
    Initializing...
    Inserted Item for Category: 4
    Inserted Item for Category: 5
    Inserted Item for Category: 5
    Inserted Item for Category: 4
    Inserted Item for Category: 4
    Verifying...
    Checking Category: 4
    INSERT INTO item_t
    ERROR at line 1:
    ORA-20001: Category 4 total = 1.4
    ORA-06512: at "PNOSKO.ITEM_AS_TRG", line 12
    ORA-04088: error during execution of trigger 'PNOSKO.ITEM_AS_TRG'
    SQL>
    SQL> SELECT * FROM item_t ORDER BY category, item_code, pct;
      CATEGORY IT        PCT
             1 AA         .3
             1 AA         .5
             1 AC         .2
             2 AB         .4
             2 AB         .6
             3 AA          1
    6 rows selected.
    SQL>

  • Mutation error

    Hi,
    I have form in which we are creating parent child relation .The table structure is as follows
    problems(table name)(prom_number,prom_relation,prom_impact,prom_relation,...)(column name).
    I dont have the forms fmb file ,So whenwe create the relation 2 update statement gets executed first in problem table the prom_number which is parent in its problem_relation column its assigned as parent and the problem which is chilld in its column value assigne dare (prom_relation,prom_prom_number)(child,and the value or pro_number which is parent).
    Now our requirement is that the value of prom_impact of child should be assigned to problem which is parent,So i have written a trigger which update the prom_impact column whcih gives mutation error.SO how can we solve this issue.

    The trigger i have written is given below.
    The problem is that from form level the table is updated twice and in the trigger i try to update the row which is parent fault .howere its show mutation error.I even created trigger which shall commit the when from problem_rlation is cahnged to parent .so that in my trigger wheh i update the column prom_imapct field in trigger there should be no reeor.Still it given mutation error.
    CREATE OR REPLACE TRIGGER parent_child_impact_trg
    AFTER UPDATE /*OF prom_relation,prom_prom_number*/ ON PROBLEMS
    REFERENCING NEW AS NEW
    FOR EACH ROW
    Version History:9.2.8.1
    (format: version, date, developer, description)
    1.0, 19-Dec-2008, Tanmoy Kr Moulik The "Impact" of Paren fault ticket
    will be changed upon manual creation of Parent Child relation
    Rules:
    1.0     Upon manual creation of new Parent-Child fault relation, the 'Fault Impact' of
    Child fault will be auto updated in the parent fault, if the parent fault impact matches
    with the attached list(Non Serve Affeect or Threat) or the impact of Parent Fault is blank (null).
    2.0     In case, the parent fault have fault impact matches with the attached list
    (service affect), then its impact is not changed while making the relationship.
    DECLARE
    PRAGMA autonomous_transaction;
    ecode NUMBER;
    emesg VARCHAR2(200);
    --BEGIN
    -- NULL;
    CURSOR c1--(v_prom_num NUMBER)
    IS
    SELECT PROM_IMPACT,prom_number FROM PROBLEMS WHERE prom_number=:NEW.prom_prom_number;
    v_prom_imp VARCHAR2(30) DEFAULT NULL;
    v_prom_imp_p1 NUMBER DEFAULT 0;
    v_prom_imp_p2 NUMBER DEFAULT 0;
    v_prom_num NUMBER;
    BEGIN
    IF :NEW.PROM_RELATION='CHILD' AND :NEW.PROM_PROM_NUMBER IS NOT NULL THEN
    --dbms_output.put_line(1);
    --INSERT INTO TEMP_PROM VALUES(:NEW.prom_number,:NEW.prom_prom_number,:NEW.prom_impact,:NEW.prom_relation);
    --COMMIT;
    OPEN c1;--(:NEW.prom_prom_number);
    FETCH c1 INTO v_prom_imp,v_prom_num;
    --INSERT INTO TEMP_PROM(PROM_NUM,PROM_IMPACT) VALUES(v_prom_num,v_prom_imp);
    --COMMIT;
    IF c1%NOTFOUND THEN
    v_prom_imp:=NULL;
    v_prom_num:=NULL;
    END IF;
    CLOSE c1;
    v_prom_imp:=UPPER(v_prom_imp);
    v_prom_imp_p1:=INSTR(v_prom_imp,'NON');
    v_prom_imp_p2:=INSTR(v_prom_imp,'THREAT');
    --INSERT INTO TEMP_PROM(PROM_NUM) VALUES(v_prom_imp_p1);
    --INSERT INTO TEMP_PROM(PROM_NUM) VALUES(v_prom_imp_p2);
    --COMMIT;
    IF v_prom_imp_p1>0 /*OR v_prom_imp_p2>0*/ THEN
    IF :NEW.prom_impact IS NOT NULL THEN
    BEGIN
    INSERT INTO TEMP_PROM(PROM_NUM,PROM_PROM_NUMBER,prom_impact,PROM_RELATION) VALUES(:NEW.prom_number,:NEW.prom_prom_number,:NEW.prom_impact,:NEW.prom_relation);
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
    INSERT INTO TEMP_PROM(prom_impact,PROM_RELATION) VALUES('failed1'||ecode,emesg);
    END;
    BEGIN
    COMMIT;
    UPDATE PROBLEMS SET PROM_IMPACT=:NEW.PROM_IMPACT WHERE prom_number=:NEW.prom_prom_number;
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
         ecode := SQLCODE;
    emesg := SQLERRM;
    -- BEGIN
    INSERT INTO TEMP_PROM(prom_impact,PROM_RELATION) VALUES('failed'||ecode,emesg);
    COMMIT;
    -- EXCEPTION WHEN OTHERS THEN*/
         NULL;
         --END;
    END;     
    END IF;     
         /*BEGIN
         INSERT INTO TEMP_PROM(PROM_NUM,PROM_IMPACT) VALUES(:NEW.prom_prom_number,:NEW.prom_impact);
         COMMIT;
    EXCEPTION WHEN OTHERS THEN
         INSERT INTO TEMP_PROM(prom_impact) VALUES('failed1');
         NULL;
         END;
    --NULL;
    -- END;
    --COMMIT;
    --END;
    /* BEGIN
    INSERT INTO TEMP_PROM(PROM_NUM,PROM_IMPACT) VALUES(:NEW.prom_prom_number,:NEW.prom_impact);
    EXCEPTION WHEN OTHERS THEN
    --INSERT INTO TEMP_PROM(prom_impact) VALUES('failed');
    NULL;
    END;
    COMMIT;
    --COMMIT;
    /* ELSIF v_prom_imp_p2>0 THEN
    -- v_prom_imp_p2
    IF :NEW.prom_impact IS NOT NULL THEN
    BEGIN
    UPDATE PROBLEMS SET PROM_IMPACT=:NEW.PROM_IMPACT WHERE prom_number=:NEW.prom_prom_number;
    EXCEPTION WHEN OTHERS THEN
    BEGIN
         ecode := SQLCODE;
    emesg := SQLERRM;
    --BEGIN
    INSERT INTO TEMP_PROM(prom_impact,PROM_RELATION) VALUES('failed'||ecode,emesg);
    COMMIT;
    --EXCEPTION WHEN OTHERS THEN
         NULL;
         END;
    NULL;
    END;
    COMMIT;
    BEGIN
    INSERT INTO TEMP_PROM(PROM_NUM,PROM_IMPACT) VALUES(:NEW.prom_prom_number,:NEW.prom_impact);
    EXCEPTION WHEN OTHERS THEN
    NULL;
    END;
    COMMIT;*/
    --UPDATE PROBLEMS SET PROM_IMPACT=:NEW.PROM_IMPACT WHERE prom_number=:NEW.prom_prom_number;
    -- COMMIT;
    -- END IF;
    END IF;
    END IF;
    EXCEPTION WHEN OTHERS THEN
    INSERT INTO TEMP_PROM(prom_impact,PROM_RELATION) VALUES('failed2'||ecode,emesg);
    COMMIT;
    NULL;
    END;

  • How to handle the mutating error

    create or replace trigger trg_t1
    after insert on t1
    begin
    insert into t1 values(1);
    end;
    i got some error..

    1011927 wrote:
    same table with the same trigger
    Within  trigger code do not issue SQL against same table upon which trigger is based; then no mutating error is thrown

  • URGENT : Trigger with Mutating Error

    Hi,
    I'm trying to write a trigger on a Table ROOM_BLOCK to update a value in table ROOM_OOI_OOS.
    As given below, which works perfectly.
    BEGIN
    IF INSERTING THEN
    IF NVL(:NEW.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)+1
    WHERE ROOM_OOI_OOS_ID = :NEW.ROOM_OOI_OOS_ID;
    END IF;
    ELSIF UPDATING THEN
    IF NVL(:OLD.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)-1
    WHERE ROOM_OOI_OOS_ID = :OLD.ROOM_OOI_OOS_ID;
    END IF;
    IF NVL(:NEW.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)+1
    WHERE ROOM_OOI_OOS_ID = :NEW.ROOM_OOI_OOS_ID;
    END IF;
    ELSE
    IF NVL(:OLD.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)-1
    WHERE ROOM_OOI_OOS_ID = :OLD.ROOM_OOI_OOS_ID;
    END IF;
    END IF;
    END;
    But when I add a select statement. the trigger seems to fail with a mutating error ORA-04091
    and Error at Line which executes the statement immidiate ORA-04088.
    DECLARE
    stmt VARCHAR2(500);
    vcount INTEGER;
    BEGIN
    IF INSERTING THEN
    --INSERT INTO SHRUTI_TEST (DESCR) VALUES ('Inserting');
    IF NVL(:NEW.ROOM_OOI_OOS_ID,0) <> 0 THEN
    stmt := 'Select count(*) from ROOM_BLOCK ' ||
    ' WHERE ROOM_OOI_OOS_ID = ' || :NEW.ROOM_OOI_OOS_ID ||
    ' AND ROOM_NO = ''' || :NEW.ROOM_NO || ''' ';
    EXECUTE IMMEDIATE stmt INTO vcount;
    IF vcount = 1 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)+1
    WHERE ROOM_OOI_OOS_ID = :NEW.ROOM_OOI_OOS_ID;
    END IF;
    END IF;
    ELSIF UPDATING THEN
    IF NVL(:OLD.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)-1
    WHERE ROOM_OOI_OOS_ID = :OLD.ROOM_OOI_OOS_ID;
    END IF;
    IF NVL(:NEW.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)+1
    WHERE ROOM_OOI_OOS_ID = :NEW.ROOM_OOI_OOS_ID;
    END IF;
    ELSE
    IF NVL(:OLD.ROOM_OOI_OOS_ID,0) <> 0 THEN
    UPDATE ROOM_OOI_OOS SET NO_OF_ROOMS = NVL(NO_OF_ROOMS,0)-1
    WHERE ROOM_OOI_OOS_ID = :OLD.ROOM_OOI_OOS_ID;
    END IF;
    END IF;
    END;
    Please tell me how to solve this problem...
    Regards
    Mike.

    Thank you for your reply to my posting.
    I researched and used your recommendation. I was
    wondering if you can help me resolve the following two
    problems.
    Table kassa1 has NAME and AGE columns. Table Kassa2
    has one column Age.
    I have created the following trigger. It keeps
    raising a ORA-06519 : Active autonomous transaction
    detected and rolled back error.
    Create or replace trigger Name_Age_Row after insert or
    update on Kassa1
    For each row
    Declare
    Total_Age VARCHAR(8);
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
         Select SUM(Age) into Total_Age from Kassa1;
         insert into kassa2 values(Total_aAge);
    End;     
    The following trigger also generates ORA-00036:
    Maximum number of recursive SQL levels(50) exceeded
    error.
    Create or replace trigger Name_Age_Row after insert or
    update on Kassa1
    For each row
    Declare
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
         insert into kassa1 values('newname', 'newage');
    End;     

  • A SMALL EXAMPLE CODE FOR MUTATING ERROR

    create or replace trigger TRG_T1
    before insert on T1
    begin
    insert into T1 values(2);
    end;
    IF I TRY TO INSERT INTO T1 TABLE I GET A MUTATING ERROR HOW CAN I SOLVE??????

    joealexander wrote:
    create or replace trigger TRG_T1
    before insert on T1
    begin
    insert into T1 values(2);
    end;
    IF I TRY TO INSERT INTO T1 TABLE I GET A MUTATING ERROR HOW CAN I SOLVE??????
    No, you do NOT get a mutating table error. You get this:
    orcl112> create table t1(c1 number);
    Table created.
    Elapsed: 00:00:00.03
    orcl112> create or replace trigger TRG_T1
      2
      3  before insert on T1
      4
      5  begin
      6
      7  insert into T1 values(2);
      8
      9  end;
    10
    11  /
    Trigger created.
    Elapsed: 00:00:00.04
    orcl112> insert into t1 values (1);
    insert into t1 values (1)
    ERROR at line 1:
    ORA-00036: maximum number of recursive SQL levels (50) exceeded
    ORA-06512: at "SCOTT.TRG_T1", line 3
    ORA-04088: error during execution of trigger 'SCOTT.TRG_T1'
    ORA-06512: at "SCOTT.TRG_T1", line 3
    ORA-04088: error during execution of trigger 'SCOTT.TRG_T1'
    ORA-06512: at "SCOTT.TRG_T1", line 3
    ORA-04088: error during execution of trigger 'SCOTT.TRG_T1'
    ORA-06512: at "SCOTT.TRG_T1", line 3
    ORA-04088: error during execution of trigger 'SCOTT.TRG_T1'
    ORA-06512: at "SCOTT.TRG_T1", line 3
    ORA-04088: error during execution of trigger 'SCOTT.TRG_T1'
    You are the second person today who has claimed to have seen this error and posted code that did not raise it. What is going on?

  • How to over come mutating error

    Can Anyone explain me how to OVERCOME Mutating error when firing a trigger ?
    Thanks in advance.

    1. Don't use triggers
    2. Don't perform DML on the same table your trigger is based on.
    Without information (such as your table create statement and your trigger code) there's not a lot else we can say right now.
    If you're getting a mutating table error, it's an indication that either your logic or your design (or both!) need rethinking...

  • Mutating error solution

    hi group
    prem here
    i am stillnot able to get the solution for mutating error.
    let me give u scenario
    before insert trigger -----on emp and in the trigger i select using the :new values , i get the mutating error,fine so far so good.
    when it comes to solution i am unable tomake out from the link which was given in one of the replies,
    can anyone pls in a simple words try to give a solution for:::::
    scenario before i insert into emp a record i need to check if there is no record present in the table
    solution ----
    after going thru few sites i could zero in to a simple solution
    1.creat a package variable store the :new variable
    2.create a procedure or function to test if record exists and pass yesy or no to the trigger and then take the decision
    also under what other cases do we get mutating errors
    pls look into this problem and give me a solution
    i hope it wll be of gr8 help to thers also
    regards
    prem

    http://asktom.oracle.com/pls/ask/f?p=4950:8:14402737568889680009::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:469621337269
    Rgds.

  • Mutating error in my trigger code

    Hi,
    Could anyone please help me out to fix the mutating error:
    I have 2 tables z_errorpayment and z_errorcorrected.
    If the status=2 in z_errorpayment table then a row has to be inserted in z_errorcorrected table and the same row has to be deleted from the 1st table i.e z_errorpayment.As it is retriving from the same table and deleting the same table am getting mutating error.
    Below is the code.
    CREATE OR REPLACE TRIGGER row_trigger
    AFTER UPDATE
    ON z_errorpayment
    FOR EACH ROW
    WHEN (NEW.status = 2)
    BEGIN
    INSERT INTO z_errorcorrected
    (mtnl_error_payment_id, file_name, entry_date,
    centre_code, service_code, instrument_flag,
    instrument_no, subs_no, instrument_dt,
    payment_mode, payment_dt, surchrg,
    telephone_no, cheque_number, cheque_dt,
    bank_code, pay_amount, receipt_no,
    terminal_id, crtn_by, crtn_dt, remarks,
    status, external_trans_id, transfer_date,
    gl_uploaded_ind_code, task_queue_id,
    user_name, old_payment_id, new_payment_id,
    payment_type
    VALUES (:NEW.mtnl_error_payment_id, :NEW.file_name, :NEW.entry_date,
    :NEW.centre_code, :NEW.service_code, :NEW.instrument_flag,
    :NEW.instrument_no, :NEW.subs_no, :NEW.instrument_dt,
    :NEW.payment_mode, :NEW.payment_dt, :NEW.surchrg,
    :NEW.telephone_no, :NEW.cheque_number, :NEW.cheque_dt,
    :NEW.bank_code, :NEW.pay_amount, :NEW.receipt_no,
    :NEW.terminal_id, :NEW.crtn_by, :NEW.crtn_dt, :NEW.remarks,
    :NEW.status, :NEW.external_trans_id, :NEW.transfer_date,
    :NEW.gl_uploaded_ind_code, :NEW.task_queue_id,
    :NEW.user_name, :NEW.old_payment_id, :NEW.new_payment_id,
    :NEW.payment_type
    DELETE FROM z_errorpayment
    WHERE new_payment_id = :NEW.new_payment_id;
    END;
    so I thought of using a view inorder to get rid of the mutating error.
    But donno how to code it.
    could anyone please help me out.
    Regards,
    Rupa

    By using a view i wrote the below code:
    CREATE OR REPLACE TRIGGER row_trigger
    INSTEAD OF UPDATE
    ON Z_ErrorView
    FOR EACH ROW
    DECLARE
    X INTEGER;
    BEGIN
    SELECT STATUS into X FROM z_errorpayment WHERE new_payment_id = :NEW.new_payment_id;
    IF X=2 THEN
    INSERT INTO z_errorcorrected
    (mtnl_error_payment_id, file_name, entry_date,
    centre_code, service_code, instrument_flag,
    instrument_no, subs_no, instrument_dt,
    payment_mode, payment_dt, surchrg,
    telephone_no, cheque_number, cheque_dt,
    bank_code, pay_amount, receipt_no,
    terminal_id, crtn_by, crtn_dt, remarks,
    status, external_trans_id, transfer_date,
    gl_uploaded_ind_code, task_queue_id,
    user_name, old_payment_id, new_payment_id,
    payment_type
    VALUES (:NEW.mtnl_error_payment_id, :NEW.file_name, :NEW.entry_date,
    :NEW.centre_code, :NEW.service_code, :NEW.instrument_flag,
    :NEW.instrument_no, :NEW.subs_no, :NEW.instrument_dt,
    :NEW.payment_mode, :NEW.payment_dt, :NEW.surchrg,
    :NEW.telephone_no, :NEW.cheque_number, :NEW.cheque_dt,
    :NEW.bank_code, :NEW.pay_amount, :NEW.receipt_no,
    :NEW.terminal_id, :NEW.crtn_by, :NEW.crtn_dt, :NEW.remarks,
    :NEW.status, :NEW.external_trans_id, :NEW.transfer_date,
    :NEW.gl_uploaded_ind_code, :NEW.task_queue_id,
    :NEW.user_name, :NEW.old_payment_id, :NEW.new_payment_id,
    :NEW.payment_type
         END IF;
    DELETE FROM z_errorpayment
    WHERE new_payment_id = :NEW.new_payment_id;
    END;

  • Mutating error in trigger

    Hi ,ihave created this trigger.its showing the mutating error as its selecting and updating the same table.So hw can we modify thsi trigger so that it worksd properly.
    CREATE OR REPLACE TRIGGER resolutionimpact
    AFTER INSERT OR UPDATE
    ON PROBLEMS
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    newcause VARCHAR2(100);
    oldcause VARCHAR2(10);
    BEGIN
    oldcause:=:OLD.PROM_NCCCAUSE;
    newcause:=:NEW.PROM_NCCCAUSE;
    IF newcause='100' THEN
    UPDATE PROBLEMS SET PROM_IMPACT='CA_TCL FLP reset';
    --PROM_IMPACT='CA_TCL FLP reset';
    END IF;
    END;

    No actually I am udating single row.Actually the value is being entered from the oracle form from front end and no matter whatever value we enter for prom_impact from front end it should overwrite that value with fixed value when we press the save button .Also we cannot do anything at form level as we have fmx and nt the fmb.So have to do it through trigger only.Also there is another trigger running on same table which fetches the value from problem table and inserts it into another table.So what can be done to solve the issue

  • Mutating error -oracle version 8i

    I have a problem of mutating error in Oracle.If u have any solution kindly forward it to me.
    I have a table e1 as shown below:
    SQL>select * from e1;
    code id transdate destination
    The trigger is to fire after insert of a row
    when "id" is 2.
    The trigger calls a procedure which calculates a new
    "transdate" and inserts a new record into the table e1 with
    the newly calculated "transdate","id" as 12 and all the other
    columns(code and destination)remains the same.
    I have to pass "code" and "transdate" as input parameters to the
    procedure.
    Inside the procedure i have a select statement which fetches
    the record from table e1(which is being inserted and fires a trigger).
    This is the rootcause of the problem.
    Since the trigger is firing after Insert,looping
    happens and hence gives out the same error.
    I even tried to use the PRAGMA AUTONOMOUS_TRANSACTION but it is not
    supported in our version.
    Please let me know if there is some other alternate to this.
    --Regards,
    Arthi

    http://osi.oracle.com/~tkyte/Mutate/index.html

  • Help with Mutating Error / Trigger / APEX_MAIL.SEND

    Hello:
    I am trying to get the apex_mail.send function working when a user submits a new record. I've taken the code from the canned Issue Tracker application code and tried to retrofit it to my tables. However I keep receiving a mutating error on line 11 (line 11 bolded below):
    -- Create a trigger that will send notification after
    -- the submission of each new idea on the IDEAS table.
    create or replace trigger IDEAS_EMAIL
    AFTER
    insert or update on IDEAS
    for each row
    begin
    IF (INSERTING AND :new.manager_name IS NOT NULL)
    OR
    (UPDATING AND (:old.manager_name IS NULL OR :new.manager_name != :old.manager_name) AND :new.manager_name IS NOT NULL) THEN
    FOR c1 IN
    (SELECT fname, lname, email
    FROM ideas_users
    WHERE fname||' '||lname = :new.manager_name)
    LOOP
    IF c1.email IS NOT NULL THEN
    FOR c2 IN
    (SELECT MANAGER_NAME, FULL_TEXT, SUMMARY, ID, SUBMITTED_BY, SUB_DATE
    FROM IDEAS
    WHERE ID = :new.ID)
    LOOP
    APEX_MAIL.SEND(
    p_to => c1.email,
    p_from => c1.email,
    p_body =>
    'This is a test message. ' ||chr(10)||
    p_subj => 'test email subject');
    END LOOP;
    END IF;
    END LOOP;
    END IF;
    end;
    I've also tried setting the following line to the primary key field in the user table and inserting that value into the main table but I still get the same error message.
    WHERE fname||' '||lname = :new.manager_name)
    Thanks in advance for any help.

    Let me get this straight..
    You are inserting a row into a table, and when you insert the row, you are going to send an e-mail t o the manager who owns this row. In the data you are inserting, is the e-mail address of the manager, right?
    David has provided the answer for you.. Use the :NEW.Email value instead of creating a cursor and all that.. Unless you have a need to e-mail multiple people of the record insert..
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"

Maybe you are looking for

  • The Gimp in Mac os 10.4.11

    Since upgrading to 10.4.11, the Gimp no longer works. When I try to open it, it says "caching fonts", and never moves on. I have tried installing to the newest version, but it didn't help. What is my problem?

  • My phone refuses to update

    I have the BB Torch 9810, 7.0 Bundle 1355 and am trying to do the 7.1.0.1997 update that my phone prompted me to do.  Ever since I got the phone, I have never been able to update a single app because it will not log me in.  Each time I try to log in,

  • How does iWeb handle packaged files. (Like Keynote files)

    I'm going to be changing this site soon, but I wanted to check here before I did. Symbolic Representation At the bottom of the page are two .key files for Keynote. When I dropped them onto iWeb, it shows them added as filename.key.zip but in the Doma

  • Month wise data

    hi, in my RTF template i am showing the data,as group by month here i want the report should show data starting by the report should show as below format month by month any please help me Jan ------------rows in the month of Jan------------ Feb -----

  • I'm downloading music and am being told I don't have access privileges to do this, getting error 5000. Help.

    I am trying to download music (having done this successfully in the past) and am now being told that I don't have the access privileges to do this. I tried restarting and I get the same thing. The download summary shows "error 5000". Help please.