CREATE OR REPLACE 
PACKAGE return_recordtable
  IS

  cursor c_emp(c_p_salary number) is
    select first_name, last_name, salary fullname from emp
    where salary < c_p_salary;

  type t_emp is table of c_emp%rowtype;
  
  FUNCTION MAX_SALARY_PIPE
    ( p_sal_max IN number)
    RETURN t_emp pipelined ;  
END; -- Package spec
/


CREATE OR REPLACE 
PACKAGE BODY return_recordtable
IS

FUNCTION MAX_SALARY_PIPE
  ( p_sal_max IN number)
  RETURN t_emp pipelined IS
      
BEGIN 
  for r in c_emp(p_sal_max) loop
      pipe row(r);
  end loop;
END;
END;
/