MySQL Forums
Forum List  »  Triggers

Re: Triggers
Posted by: Ronan Cashell
Date: April 21, 2011 01:17PM

Basically you can access in an UPDATE trigger both the old and the new values of the fields in question. So far example in your trigger on table respondent you can access new.jobnum or old.jobnum from within your trigger. In your case these should both be the same value.

So your trigger would look something like this:

drop trigger if exists tsu_resp;
create trigger tsu_resp after update on respondent for each row
update job set ts=current_timestamp and jobnum = new.jobnum;

The new.jobnum is taking its value from the respondent table that is being updated and the new value if it is being updated.

Ronan Cashell
Senior Oracle/MySQL Administrator
IT Integrated Business Solutions
http://www.it-iss.com

Options: Reply• Quote


Subject
Views
Written By
Posted
3156
April 20, 2011 03:17PM
1245
April 20, 2011 04:51PM
1603
April 21, 2011 11:03AM
Re: Triggers
1183
April 21, 2011 01:17PM
1249
April 21, 2011 02:53PM
1163
April 21, 2011 05:16PM
1219
April 21, 2011 07:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.