The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question, Chaitanya.
Asked: June 08, 2017 - 8:01 am UTC
Last updated: June 09, 2017 - 2:40 am UTC
Version: 11g
Viewed 1000+ times
SQL> create or replace type myobj as object ( x int, y int ); 2 / Type created. SQL> create or replace type mylist is table of myobj; 2 / Type created. SQL> SQL> create or replace package pkg is 2 function f return mylist pipelined; 3 end; 4 / Package created. SQL> create or replace 2 package body pkg is 3 function f return mylist pipelined is 4 begin 5 for i in 1 .. 10 loop 6 pipe row ( myobj (i,i+1)); 7 end loop; 8 end; 9 end; 10 / Package body created. SQL> SQL> select * from table(pkg.f); X Y ---------- ---------- 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 10 rows selected. SQL> SQL>
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library