Hi, I am trying to create a table with the below structure
KEY
DATA
CREATE_TIMESTAMP
LAST_UPDATE_TIMESTAMP
The timestamp value needs to be updated when everytime the row gets updated. So I am trying to create a trigger with the below code
CREATE TRIGGER `schemaname`.`triggername` AFTER UPDATE ON `tablename` FOR EACH ROW
BEGIN
SET tablename.LAST_UPDATE_TIMESTAMP = NOW();
END
I try to execute this in workbench but I am getting an error on this one.
ERROR 1193: Unknown system variable 'LAST_UPDATE_TIMESTAMP'
SQL Statement:
CREATE TRIGGER `schemaname`.`triggername` AFTER UPDATE ON `tablename` FOR EACH ROW
BEGIN
SET tablename.LAST_UPDATE_TIMESTAMP = NOW();
END
KEY
DATA
CREATE_TIMESTAMP
LAST_UPDATE_TIMESTAMP
The timestamp value needs to be updated when everytime the row gets updated. So I am trying to create a trigger with the below code
CREATE TRIGGER `schemaname`.`triggername` AFTER UPDATE ON `tablename` FOR EACH ROW
BEGIN
SET tablename.LAST_UPDATE_TIMESTAMP = NOW();
END
I try to execute this in workbench but I am getting an error on this one.
ERROR 1193: Unknown system variable 'LAST_UPDATE_TIMESTAMP'
SQL Statement:
CREATE TRIGGER `schemaname`.`triggername` AFTER UPDATE ON `tablename` FOR EACH ROW
BEGIN
SET tablename.LAST_UPDATE_TIMESTAMP = NOW();
END