This commit is contained in:
parent
4d2637764e
commit
b9fe990003
|
@ -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