 CREATE FUNCTION check_type_nomenclature(id integer, id_type integer) RETURNS boolean
     LANGUAGE plpgsql IMMUTABLE
     AS $$
---fonction permettant de vérifier si un id_nomenclature correspond au type de nomenclature souhaité
+--Function that checks if an id_nomenclature matches with wanted nomenclature type
   BEGIN
     IF id IN(SELECT id_nomenclature FROM nomenclatures.t_nomenclatures WHERE id_type_nomenclature = id_type ) THEN
       return true;

    idnomenclature integer)
  RETURNS integer AS
$BODY$
  --fonction permettant de renvoyer l'id nomenclature correspondant à la sensibilité de l'observation
  --USAGE : SELECT nomenclatures.calcul_sensibilite(240,21);
  DECLARE
  idsensibilite integer;

CREATE FUNCTION get_filtered_nomenclature(idtype integer, myregne character varying, mygroup character varying) RETURNS SETOF integer
    LANGUAGE plpgsql IMMUTABLE
    AS $$
--Function that returns a list of id_nomenclature depending on regne and/or group2_inpn sent with parameters.
  DECLARE
    thegroup character varying(255);
    theregne character varying(255);
