salix/db/routines/vn/procedures/travel_checkDates.sql

18 lines
449 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkDates`(vShipped DATE, vLanded DATE)
BEGIN
/**
* Checks the landing/shipment dates of travel, throws an error
* ir they are not correct.
*
* @param vShipped The shipment date
* @param vLanded The landing date
*/
IF vLanded < vShipped THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Landing cannot be lesser than shipment';
END IF;
END$$
DELIMITER ;