Results 1 to 7 of 7

Thread: Mutating Error

  1. #1
    Join Date
    Sep 2004
    Posts
    60

    Question Unanswered: Mutating Error

    I am not sure but, Mutating Error in trigger can be solved by using view of the table which is being update by trigger.
    Is this is true & if yes, how we can use it.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Here is a nice Tom Kyte's walkthrough this problem.

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    ... and no, it isn't true that using a view solves the problem!

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Perhaps he heard something about accessing the :old values; Tom, in his article, says that
    Quote Originally Posted by Tom Kyte
    In Oracle8.0 and up, we could use "INSTEAD OF" triggers on a view to do this, but in 7.3 ...

  5. #5
    Join Date
    Sep 2004
    Posts
    60
    Thanks for your Posts. I readed Tom's suggestion about problem. But it is difficult some time, when you want to access Old & New values in same trigger, which is leading to problem.

    I would prefer using "pragma autonomous_transaction;" . I see no harm of using it in most of conditions, I can think.

    Is their any issue you would like to bring for usage of
    " pragma autonomous_transaction;"

    Thanks for putting your time for this.

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Resolving mutating table errors with autonomous_transaction pragma can be done, but it requires a good understanding of the transaction. You might mess things up if this pragma is used "out of control".

    Although sometimes it is helpful, most of the times the answer to the question "should I use autonomous_transaction?" will be "no".

    Here is another Tom Kyte's article which also deals with mutating tables and autonomous_transaction pragma.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,296
    perhaps you should:
    1. show us the trigger and the error
    2. explain what you want to do

    then perhaps we can get to the meat of the issue and solve it
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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