DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`invoiceIn_beforeDelete` BEFORE DELETE ON `invoiceIn` FOR EACH ROW BEGIN CALL invoiceIn_checkBooked(OLD.id); END$$ DELIMITER ;