-- PackageCREATE OR REPLACEPackage test_141215 isTYPE type_ref isRecord (enameVARCHAR2( -), SAL Number(Ten)); TYPE T_type_ref is TABLE ofType_ref; FUNCTIONRetrieve (V_namevarchar2)RETURNt_type_ref pipelined;ENDtest_141215;--Package BODYCREATE OR REPLACEPackage BODY test_141215 is FUNCTIONRetrieve (V_namevarchar2)RETURNt_type_ref pipelined isCur_type_ref Type_ref; Type ref_cur_variable isREFcursor; Cur_variable ref_cur_variable; --rec_emp Type_ref%rowtype;V_sqlvarchar2( -) := 'Select T.ename, t.sal/*, t.empno*/from Scott.emp t'; BEGIN OpenCur_variable forV_sql; LoopFetchcur_variable intoCur_type_ref; Exit whenCur_variable%NotFound; Dbms_output.put_line (cur_variable%RowCount || ' -' ||Cur_type_ref.ename|| ' ' ||cur_type_ref.sal); PIPEROW (CUR_TYPE_REF); EndLoop; Closecur_variable; RETURN; END;ENDtest_141215;--Test RetrieveSelect * from Table(Test_141215.retrieve ('ASD'));
Oracle plsql Demo-18.02. Pipeline function[Query fragmented fields make up list pipeline return] [field must be up]