If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Triggers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-11, 15:29
MariahLee MariahLee is offline
Registered User
 
Join Date: Feb 2011
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 02-12-11, 20:38
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
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.
Reply With Quote
  #3 (permalink)  
Old 02-14-11, 16:34
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On