refs #6834 feat:handle Error #2057

Merged
sergiodt merged 4 commits from 6834_sectorCollectionSaleGroup_add into dev 2024-02-21 11:06:54 +00:00
1 changed files with 19 additions and 0 deletions

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 saleGroup

FROM saleGroup
sols una taula va sense alias

FROM saleGroup sols una taula va sense alias

Fet

Fet
WHERE id = vSaleGroupFk;
IF !vHasSaleGroup THEN
CALL util.throw ("invalid saleGroup");

Els throws van en minúscules i separades, busca un exemple

Els throws van en minúscules i separades, busca un exemple

He trobat un poc de tot, ho apunte en Convenciones SQL ?

He trobat un poc de tot, ho apunte en Convenciones SQL ?
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;