CREATE OR REPLACE FUNCTION food600.getidoperslave(
	idopermaster integer)
    RETURNS character varying
    LANGUAGE 'plpgsql'

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