Results 1 to 3 of 3

Thread: Triggers

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Unanswered: Triggers

    Hi everyone,

    How to make firing a trigger cause another trigger to fire??
    for example
    if I have two table one is called orders and the other called reorders
    trigger One
    update a column called item_reorder in ORDERS table to be yes
    triger 2
    insert to another table

  2. #2
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    MariahLee, the only thing that will 'fire' a trigger is DML (Insert, Update, or Delete). I am not sure if that will work in your process (not very clear on the steps involved). You may need a stored procedure to do the updates.

  3. #3
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    In other words, what DML is going to happen that will fire the trigger to update table orders that will update the column item_reorder? One trigger, does not "fire another", a trigger does some action, based on an action that has occurred in the database. That triggered action could fit the definition of some other trigger, that causes the second trigger to "fire".

    I think what you are after is more like a single trigger. You have a process that will update the table orders and update the column item_reorder to yes, then you just need a trigger that will fire after that update to insert the appropriate data to the reorder table.

    Dave

Posting Permissions

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