Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Triggers in MySQL example

delimiter //
CREATE TRIGGER person_bi BEFORE INSERT
ON person
FOR EACH ROW
IF NEW.age < 18 THEN
SIGNAL SQLSTATE '50001' SET MESSAGE_TEXT = 'Person must be older than 18.';
END IF; //
delimiter ;
Source by phoenixnap.com #
 
PREVIOUS NEXT
Tagged: #Triggers #MySQL
ADD COMMENT
Topic
Name
9+9 =