CREATE OR REPLACE FUNCTION food600.getidhoresmaster(
	idhores integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE idhoresmaster INTEGER;
BEGIN
SELECT idriadok_master INTO idhoresmaster FROM food600.hores_d WHERE idriadok=idhores;
RETURN btrim(idhoresmaster::character(20));
END
$BODY$;
