refs #6915 test_master24_8 #2067

Merged
alexm merged 561 commits from test_master24_8 into master 2024-02-22 07:31:34 +00:00
1 changed files with 19 additions and 0 deletions
Showing only changes of commit b9fe990003 - Show all commits

View File

@ -8,6 +8,25 @@ BEGIN
* @param vSaleGroupFk Identificador de vn.saleGroup
* @param vSectorCollectionFk Identificador de vn.sectorCollection
*/
DECLARE vHasSaleGroup INT;
DECLARE vHasSectorCollection INT;
SELECT COUNT(id) INTO vHasSaleGroup
FROM vn.saleGroup sg
WHERE sg.id = vSaleGroupFk;
IF !vHasSaleGroup THEN
CALL util.Throw ("INVALID_SALEGROUP");
END IF;
SELECT COUNT(id) INTO vHasSectorCollection
FROM vn.sectorCollection scsg
WHERE scsg.id = vSectorCollectionFk;
IF !vHasSectorCollection THEN
CALL util.Throw ("INVALID_SECTORCOLLECTION");
END IF;
REPLACE sectorCollectionSaleGroup
SET sectorCollectionFk = vSectorCollectionFk,
saleGroupFk = vSaleGroupFk;