CREATE OR REPLACE FUNCTION food600.getidspravamaster(
	idsprava integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE idspravamaster INTEGER;
BEGIN
SELECT id_sprava_master INTO idspravamaster FROM food600.spravy WHERE id_sprava=idsprava;
RETURN btrim(idspravamaster::character(20));
END
$BODY$;
