2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkDates`(vShipped DATE, vLanded DATE)
|
2024-01-15 11:31:03 +00:00
|
|
|
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 ;
|