MySQL Forums
Forum List  »  Triggers

can't update table 'users' in stored function/trigger because
Posted by: Paul Polin
Date: April 18, 2012 12:54AM

I am trying to update a table 'users' after update

the username must be = email adress

DELIMITER $$
CREATE TRIGGER trg_user_email AFTER UPDATE ON users
FOR EACH ROW
BEGIN
IF NEW.email <> OLD.email THEN
UPDATE users SET username = email ;
END IF;
END $$

and I am getting
Can't update table 'users' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.


how can I solve it ?

thank you

Options: ReplyQuote


Subject
Views
Written By
Posted
can't update table 'users' in stored function/trigger because
4585
April 18, 2012 12:54AM


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.