Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009

    Exclamation Unanswered: update table into trigger but on same table trigger based

    Hello !

    Here is my pbl ; I have a trigger on a table TAB1. The trigger fires After update in order to be able to execute an update command. This update have to update others records on the same table TAB1.

    Is that possible ? and do the trigger fires again for the other updated records and again and again ??

    thanks for your answer
    Last edited by rd4004; 05-20-09 at 03:23. Reason: update the title

  2. #2
    Join Date
    May 2009
    Provided Answers: 1
    rd4004, you should be able to do what you want without getting into an endless set of triggers firing.

    When you create an UPDATE trigger you can specify OF COLUMN col-name(s).

    For example:

    Trigger1 AFTER UPDATE OF COLUMN col1 (action update col2)
    Trigger2 AFTER UPDATE OF COLUMN col2 (action update col3)
    Trigger3 AFTER UPDATE OF COLUMN col3 (action update col4)

    Update table-name SET col1 = value WHERE ...

    This will fire Trigger1 which updates col2
    This will fire Trigger2 which updates col3
    This will fire Trigger3 which updates col4

    And you are done.

    PS If Trigger3 updated col1 or col2 then you would have a problem.

  3. #3
    Join Date
    Dec 2007
    Richmond, VA
    Provided Answers: 5
    you can put when condition on when to fire the trigger, such as columnX <> ??? or columna = ???

  4. #4
    Join Date
    May 2012
    Stealth_DBA u r the mann... I'm facing this problem all weekend on...
    10x man

Posting Permissions

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