MySQL Forums
Forum List  »  Triggers

Re: Creating trigger on update of a particular column of a table
Posted by: William Chiquito
Date: September 28, 2007 03:30PM

Hi mangesh,

Try:
DELIMITER $$

DROP TRIGGER /*!50032 IF EXISTS */ `CHANGEEMP`$$

CREATE TRIGGER `CHANGEEMP` AFTER UPDATE on `EMP`
FOR EACH ROW BEGIN
	IF NEW.salary != OLD.salary THEN
		INSERT INTO tempSalary (Salary) VALUES (NEW.salary);
	END IF;
END$$

DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Creating trigger on update of a particular column of a table
17789
September 28, 2007 03:30PM


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.