DELIMITER $$ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmap_beforeInsert` BEFORE INSERT ON `roadmap` FOR EACH ROW BEGIN SET NEW.editorFk = account.myUser_getId(); IF NEW.tractorPlate IS NOT NULL THEN CALL vehicle_checkNumberPlate(NEW.tractorPlate, NULL); END IF; IF NEW.trailerPlate IS NOT NULL THEN CALL vehicle_checkNumberPlate(NEW.trailerPlate, NULL); END IF; END$$ DELIMITER ;