CREATE OR REPLACE FUNCTION food600.getidopermaster(
	idoper integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'

    COST 100
    VOLATILE 
    
AS $BODY$
DECLARE idopermaster INTEGER;
BEGIN
SELECT id_oper_master INTO idopermaster FROM kredit.hk_operacie WHERE id_oper=idoper;
RETURN btrim(idopermaster::character(20));
END
$BODY$;
