Merge pull request 'refs #6834 feat:handle Error' (!2057) from 6834_sectorCollectionSaleGroup_add into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2057 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
1328a8fa96
|
@ -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 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
|
||||
SET sectorCollectionFk = vSectorCollectionFk,
|
||||
saleGroupFk = vSaleGroupFk;
|
||||
|
|
Loading…
Reference in New Issue