refs #6915 test_master24_8 #2067
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue