CREATE OR REPLACE FUNCTION food600.getidstatmaster(
	idstat integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE idstatmaster INTEGER;
BEGIN
SELECT id_stat_master INTO idstatmaster FROM food600.nlimitstatus WHERE id_stat=idstat;
RETURN btrim(idstatmaster::character(20));
END
$BODY$;
