create or replace function function_demo RETURN emp PIPELINED as Type ref_cur_emp IS REF CURSOR RETURN emp%RowType; cur_emp ref_cur_emp; rec_emp cur_emp%RowType; begin Open cur_emp For select * from emp t; Loop fetch cur_emp InTo rec_emp; Exit When cur_emp%NotFound; PIPE ROW(rec_emp); End Loop; Close cur_emp; end function_demo;