Trigger for read-only column
I am trying to make one of my table's column read-only and I created the following triggers but i am getting a syntax error.
CREATE TRIGGER client_id_lock before
UPDATE
ON
reeher_dash_dbo.users_column_lock FOR EACH row BEGIN IF OLD.client_id THEN SIGNAL SQLSTATE '45000'
SET
MESSAGE_TEXT = 'Cannot update locked record';
END IF;
END;
I got the following error
ERROR 1064 (42000): 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 '' at line 6
mysql> END IF;
ERROR 1064 (42000): 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 IF' at line 1
mysql> END;
did I miss anything?
Subject
Views
Written By
Posted
Trigger for read-only column
2999
June 12, 2013 07:53AM
1826
June 12, 2013 09:25AM
4383
June 12, 2013 01:57PM
1726
June 15, 2013 09:46AM
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.