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

16 lines
369 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`saleTracking_del`(vSaleFk INT, vState VARCHAR(50))
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 ;