salix/db/routines/vn/triggers/shelving_beforeInsert.sql

14 lines
285 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`shelving_beforeInsert`
BEFORE INSERT ON `shelving`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.code = "" THEN
CALL util.throw('NOT_EMPTY_CODE_ALLOWED');
END IF;
END$$
DELIMITER ;