DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `stock`.`log_clean`() BEGIN DELETE FROM inbound WHERE dated = vn.getInventoryDate(); DELETE FROM outbound WHERE dated = vn.getInventoryDate(); END$$ DELIMITER ;