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