7199-devToTest_2316 #2287
|
@ -8,6 +8,25 @@ BEGIN
|
||||||
* @param vSaleGroupFk Identificador de vn.saleGroup
|
* @param vSaleGroupFk Identificador de vn.saleGroup
|
||||||
* @param vSectorCollectionFk Identificador de vn.sectorCollection
|
* @param vSectorCollectionFk Identificador de vn.sectorCollection
|
||||||
*/
|
*/
|
||||||
|
DECLARE vHasSaleGroup INT;
|
||||||
|
DECLARE vHasSectorCollection INT;
|
||||||
|
|
||||||
|
SELECT COUNT(id) INTO vHasSaleGroup
|
||||||
|
FROM saleGroup
|
||||||
|
WHERE id = vSaleGroupFk;
|
||||||
|
|
||||||
|
IF !vHasSaleGroup THEN
|
||||||
|
CALL util.throw ("invalid saleGroup");
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT COUNT(id) INTO vHasSectorCollection
|
||||||
|
FROM sectorCollection
|
||||||
|
WHERE id = vSectorCollectionFk;
|
||||||
|
|
||||||
|
IF !vHasSectorCollection THEN
|
||||||
|
CALL util.throw ("invalid sectorCollection");
|
||||||
|
END IF;
|
||||||
|
|
||||||
REPLACE sectorCollectionSaleGroup
|
REPLACE sectorCollectionSaleGroup
|
||||||
SET sectorCollectionFk = vSectorCollectionFk,
|
SET sectorCollectionFk = vSectorCollectionFk,
|
||||||
saleGroupFk = vSaleGroupFk;
|
saleGroupFk = vSaleGroupFk;
|
||||||
|
|
Loading…
Reference in New Issue