MySQL Forums
Forum List  »  Triggers

Re: After update trigger on same table
Posted by: Peter Brawley
Date: September 23, 2011 01:18PM

> whenever a specific column('Num_cons_logins')gets updated I need to update another column of the same table

You can change column values in the row referenced in the trigger ...

if new.nums_cons_logins <> old.nums_cons_logins then
  set new.othercolname=othervalue;
end if;
[/end if;

You can't update other rows in the same table (because that would incite an infinite loop).

PB

Options: ReplyQuote


Subject
Views
Written By
Posted
2737
September 23, 2011 05:14AM
Re: After update trigger on same table
1872
September 23, 2011 01:18PM


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.