DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: mutating error

  1. #1
    Join Date
    Jul 2002
    Posts
    1

    Smile

    Hi
    ---------------------------------
    I have a table AAAA. On this table I have a befor update
    trigger (AAAA_BU_STATUS) . In this trigger I have a
    command with below syntax on updating (status)

    select distict 'X'
    from AAAA
    wher year=:new.year and status=1;

    ---------------------------------
    When I updateing status in FORM (On AAAA table) , I
    get a mutating error.
    I want check a request on AAAA brfor updateing AAAA.


    Please help my


  2. #2
    Join Date
    Jul 2002
    Posts
    9
    Hello,

    Why You dont try to create this trigger
    with a when clause eg:

    create or replace trigger YOUR_TRIGGER before update of status on AAAA
    for each row
    when (new.year=old.year and new.status = 1)
    begin
    -- your code here
    end;

    Silas - silas.silva@tecmind.com.br
    ---------------------------------------

  3. #3
    Join Date
    Jul 2002
    Posts
    9
    Why You dont try to create this trigger
    with a when clause eg:

    create or replace trigger YOUR_TRIGGER before update of status on AAAA
    for each row
    when (new.year=old.year and new.status = 1)
    begin
    -- your code here
    end;


    In last sample i've included then column status in before clause, but, i believe, to fire a trigger only in the records you want, You need to like this sample.

    Silas - silas.silva@tecmind.com.br
    ---------------------------------------


  4. #4
    Join Date
    Jul 2002
    Posts
    9

    Talking

    create or replace trigger YOUR_TRIGGER before update on AAAA
    for each row
    when (new.year=old.year and new.status = 1)
    begin
    -- your code here
    end;

    Now, i'm sending the correct sample! without the column on before update clause!

    Try, this! reply to me the result!

    ---------------------------------------
    Silas - silas.silva@tecmind.com.br

  5. #5
    Join Date
    May 2002
    Posts
    2,645
    "I want check a request on AAAA brfor updateing AAAA."

    Those pesky triggers and mutation. You can't reference the table inside of the trigger. The table may be changing ("mutating") so Oracle doesn't let you look ("select") at it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width