2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`saleTracking_del`(vSaleFk INT, vState VARCHAR(50))
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
|
|
|
|
DELETE FROM itemShelvingSale
|
|
|
|
WHERE saleFk = vSaleFk;
|
|
|
|
|
|
|
|
DELETE st.*
|
|
|
|
FROM vn.saleTracking st
|
|
|
|
JOIN vn.state s ON s.id = st.stateFk
|
|
|
|
WHERE st.saleFk = vSaleFk
|
|
|
|
AND s.code = vState COLLATE utf8_unicode_ci;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|