I have a table called Account, with some coulmns (name, family_name, username, password, email), I need to start a trigger which starts a stored procedure only when an update is done to the Username column, not if I update any other column. I'm trying to do that as follows in the code. My DB is MySQL 5.1 Server.
I have a syntax error 'near REFERENCING NEW ROW AS new_user, OLD ROW AS old_user
FOR EACH ROW
ModificaUserna' at line 3
CODE
CREATE VIEW username_view
AS SELECT username
FROM account;
CREATE TRIGGER modifica_username
AFTER UPDATE ON username_view
REFERENCING NEW ROW AS new_user, OLD ROW AS old_user
FOR EACH ROW
ModificaUsername(old_user.username_view, new_user.username_view);
Which is the problem? Is there another way to do what I need?