Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2003
    Posts
    81

    Unanswered: Order of triggers

    How do I control the order in which my triggers are executed. So that trigger1 is executed before trigger2, etc.?

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    As far as I can tell, you can't.

    If code needs to be executed in a specific order, put it into a stored procedure and let one trigger invoke this procedure which will then do the job.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Triggers fire in random order AT the same level.
    Before statement - fired first
    before row - fired second
    after row - fired third
    after statement first forth.
    However, if you have 10 before row (for example), they would all fire in random order. As littlefoot said, write ONE trigger of the particular type and fire the code sequentially within the trigger.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jun 2003
    Posts
    81
    Okay
    But my problem is, that I need to split up my triggers because of mutating data. If I put it all into one procedure called by one single trigger I am back to my original problem. :-(

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Perhaps you didn't quite understand how to solve mutating table error?

  6. #6
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Quote Originally Posted by Littlefoot
    Perhaps you didn't quite understand how to solve mutating table error?
    ... in which case see this Tom Kyte article on how to solve it properly.

Posting Permissions

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