CREATE OR REPLACE FUNCTION food600.getidtypmaster(
	idtyp integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE idtypmaster INTEGER;
BEGIN
SELECT id_typ_master INTO idtypmaster FROM food600.nlimittypy WHERE id_typ=idtyp;
RETURN btrim(idtypmaster::character(20));
END
$BODY$;
