Click to See Complete Forum and Search --> : [MySQL] REFERENCING problem


Alhazred
September 27th, 2008, 01:00 PM
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


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?

ahoodin
September 27th, 2008, 04:16 PM
Alhazred Are you a LoveCraft Fan? Did you write the Necronomicon?

:thumb:

Alhazred
September 27th, 2008, 05:47 PM
Of course I did, but now I'm trying to write something different, I live in a new age now, things are not as they were centuries ago.
I'm trying with programming.