Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DEFINER = CURRENT_USER TRIGGER `mydb`.`Secondaries_AFTER_INSERT` AFTER INSERT ON `Secondaries` FOR EACH ROW
- BEGIN
- DECLARE c INT;
- set c = (SELECT COUNT(*) FROM `Characteristics` WHERE `attribute_tag` = NEW.`attribute_tag`);
- IF (c > 0) THEN BEGIN
- DELETE FROM `Secondaries` WHERE `attribute_tag` = NEW.`attribute_tag`;
- END; END IF;
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement