MySQL Forums
Forum List  »  Triggers

Database Trigger does not seem to work
Posted by: michael evangelista
Date: August 10, 2011 11:34PM

Hi, I was just wondering as to why my trigger does not work in mysql. It keeps on saying error code 1235, but i have already checked my syntax, and it seems to be alright.

the 2 tables I am using have both type_id field in them, 1 as a primary key(in table typcode). Could I have written the code improperly which is why it is telling me I am updating the same table?

DELIMITER $$

USE `database`$$

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

CREATE

TRIGGER `tri_dirty_bit_update_hr_employee` AFTER UPDATE ON `hr_employee`
FOR EACH ROW BEGIN
UPDATE typecode SET dirty_bit_ind = '1' WHERE type_id = NEW.type_id AND div_id = NEW.div_id AND comp_id = NEW.comp_id;
END;
$$

DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Database Trigger does not seem to work
2679
August 10, 2011 11:34PM


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.