(Edit: Apologies for the funky formatting. SO was not having my code formatted.)
I feel dumb, but i've been racking my brain for this for longer then I like to admit.
I need a trigger that, when any update to menu_button is made, it updates a field in soa_config
to the datetime the update was made (parameterValue
is a Varchar
). I've tried doing it as simple as setting parameterValue='1'
, no dice either. Running the update by itself, and the trigger, sans everything, and both work. It's the combination of the two that makes it hard. I get the error
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 1".
delimiter |
CREATE TRIGGER imatrigger AFTER UPDATE on `menu_button`
FOR EACH ROW
BEGIN
UPDATE soa_config
SET parameter_value = 'CURRENT_TIMESTAMP'
WHERE parameter_name = last_menu_update_itme
END
|
delimiter ;
I've looked at: Quick MySQL Trigger Update
Trouble in creating Trigger in MySQL
sql creating a trigger on update
and more googling.