Hello to all

I would like to modify a function so you do not have to use cursors. I would like the function I returned a table and avoid having output parameters (in this case the two sliders returned) but only input.
This is because I am developing an application in QT and I can not handle the return of the sliders for more parameters assigned as output.

thanks
Code:
This is the code: 
-- Function: f_get_missionplan_filter(refcursor, refcursor, numeric, text, text, text, text, text)  
  
-- DROP FUNCTION f_get_missionplan_filter(refcursor, refcursor, numeric, text, text, text, text, text);  
  
CREATE OR REPLACE FUNCTION f_get_missionplan_filter(refcursor, refcursor, numeric, text, text, text, text, text)  
  RETURNS SETOF refcursor AS  
$BODY$  
  
DECLARE  
    
  v_message   character varying(300);  
  v_function  character varying(300);  
  v_operation character varying(300);  
  ret_log     smallint;  
  p_debug     smallint := 0;  
  sql         character varying(3000);  
  p_sens      smallint;  
  p_geom      character varying(500);  
  p_image     character varying(50);  
  p_video     character varying(50);  
  p_date_da   character varying(50);  
  p_date_fino character varying(50);  
  count_temp  smallint := 0;  
  
BEGIN  
  
  v_function := 'f_get_missionplan_filter';  
  v_operation := 'select';  
  
  p_sens      := $3;  
  p_geom      := $4;  
  p_image     := $5;  
  p_video     := $6;  
  p_date_da   := $7;  
  p_date_fino := $8;  
  
  EXECUTE 'SELECT COUNT(*) FROM information_schema.tables WHERE table_name=''temp_f_get_dati'''  
    INTO count_temp;  
  
  IF count_temp > 0 THEN  
    DELETE FROM temp_f_get_dati;  
  ELSE  
    EXECUTE 'CREATE TEMPORARY TABLE temp_f_get_dati (  
             missionplanid bigint ,  
             missionplanname character varying(50),  
             description character varying(200),  
             code character varying(10),  
             statusid bigint,  
             type character varying(50)  
             )';  
  END IF;  
  
  if p_sens  = -1 and  
     p_geom = ''  and     
     p_image = '' and     
     p_video = '' and     
     p_date_da = '' and    
     p_date_fino = ''   then  
  
    sql:='insert into temp_f_get_dati  
         (missionplanid, missionplanname, description, code, statusid)  
         (SELECT distinct mp.missionplanid,  
                          mp.missionplanname,  
                          mp.description as missionplan_desc,  
                          mp.code,  
                          mp.statusid  
          FROM missionplan mp  
          WHERE mp.statusid = 8)';  
  
  else  
    
    sql:='insert into temp_f_get_dati  
         (missionplanid,   missionplanname, description, code, statusid)  
         (SELECT distinct mp.missionplanid,  
                          mp.missionplanname,  
                          mp.description as missionplan_desc,  
                          mp.code,  
                          mp.statusid  
          FROM missionplan    mp,  
               missionplanuav m,  
               task           t,  
               targettask     tt,  
               target         ta,  
               areatype       at,  
               mission        mm';  
                   
    if p_sens <> -1 then  
      sql:=sql||' ,sensortask st, sensor sen ';  
    end if;  
      
    if p_image <> '' or p_video <> '' then  
      sql:=sql||',source s ';  
    end if;  
          
    if p_image <> '' then  
      sql:=sql||',image i ';  
    end if;  
      
    if p_video <> '' then  
      sql:=sql||',video v ';  
    end if;  
      
    sql:=sql||' where t.missionplanuavid = m.missionplanuavid and mp.missionid = mm.missionid ';  
      
    if p_sens <> -1 then  
      sql:=sql||' and st.taskid = t.taskid and sen.sensorid = st.sensorid and sen.SensorTypeID = '||p_sens||' ';  
    end if;  
  
    sql:=sql||' and mp.missionplanid = m.missionplanid  
                and t.taskid = tt.taskid  
                and tt.targetid = ta.targetid  
                and ta.areatypeid = at.areatypeid   
                and mp.statusid = 8 ';  
                  
    if p_image <> '' or p_video <> '' then  
      sql:=sql||' and s.missionplanuavid = m.missionplanuavid ';  
    end if;  
      
    if p_video <> '' then  
      sql:=sql||' and v.sourceid = s.sourceid ';  
    end if;  
      
    if p_image <> '' then  
      sql:=sql||' and i.sourceid = s.sourceid ';  
    end if;  
      
    if p_geom <> '' then  
      sql:=sql||' and true = ST_Within(ta.geom,ST_GeomFromText('||quote_literal(p_geom)||')) ';  
    end if;  
      
    if p_date_da <> '' then  
      sql:=sql||' and date_trunc(''day'', m.executionstart) >= '||p_date_da||' and date_trunc(''day'', m.executionstart) <= '||p_date_fino||'';  
    end if;  
  
    sql:=sql||' and m.missionplanuavid = t.missionplanuavid)';  
  
  end if;  
  
  EXECUTE sql;  
      
  open $1 for  
    select distinct * from temp_f_get_dati;  
      
  open $2 for  
    SELECT t.targetid,  
           t.targetname,  
           t.description as targetdesc,  
           tt.targettypename,  
           tt.description as targettypedesc,  
           a.areatypename,  
           a.description as areatypedesc  
      FROM missionplan          mp,  
           missionplanuav       mu,  
           missionplanuavtarget mput,  
           areatype             a,  
           target               t,  
           targettype           tt  
     where mp.missionplanid in (select distinct missionplanid from temp_f_get_dati)  
       and mu.missionplanid = mp.missionplanid  
       and mput.missionplanuavid = mu.missionplanuavid  
       and mput.targetid = t.targetid  
       and a.areatypeid = t.areatypeid  
       and tt.targettypeid = t.targettypeid  
       and mu.statusid = 8  
       and mu.mpuversion = '0.0';  
  
  RETURN NEXT $1;  
  RETURN NEXT $2;  
  
EXCEPTION  
  WHEN OTHERS THEN  
    v_message := v_function || ' - ' || v_operation || ' - ERROR - ' || sqlstate || ' - ' || sqlerrm;  
    ret_log   := f_write_log(v_message);  
    RETURN NEXT - 1;  
END; $BODY$  
  LANGUAGE 'plpgsql' VOLATILE  
  COST 100  
  ROWS 1000;  
ALTER FUNCTION f_get_missionplan_filter(refcursor, refcursor, numeric, text, text, text, text, text) OWNER TO postgres;  
COMMENT ON FUNCTION f_get_missionplan_filter(refcursor, refcursor, numeric, text, text, text, text, text) IS 'Function Filter on MissionPlan   
It returns a missionplan recordset and a target recordset by the selected filter with statusid equal to 8 (Completed) :  
Param 3 if is not -1, contains the id of the sensor type filter  
Param 4 if is not empty string, contains the target area to be filtered  
Param 5 if is not empty string, the images are filtered  
Param 6 if if not empty string, the Videos are filtered  
Param 7 filters between the start date of missionexecution and Param 8 the end date of missionexecution  
';