CREATE OR REPLACE FUNCTION food600.getidskupmaster(
	idskup integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE idskupmaster INTEGER;
BEGIN
SELECT id_skup_master INTO idskupmaster FROM food600.spravyskupiny WHERE id_skup=idskup;
RETURN btrim(idskupmaster::character(20));
END
$BODY$;
