SOURCE
create or replace TRIGGER t_salles
BEFORE INSERT OR UPDATE ON salles
FOR EACH ROW
DECLARE
compte number;
groupe_impossible EXCEPTION;
BEGIN
SELECT COUNT(g.p_id)
INTO compte
FROM groupes g, types_groupes tg
WHERE g.p_id = :new.f_site
AND tg.p_id = g.f_type
AND tg.libelle = 'site';
IF (compte != 1)
THEN
	RAISE groupe_impossible;
END IF;
END;