SQL> SQL> -- How do you get the stuff out of table of records? SQL> SQL> -- Beware of the syntax put the "from table" at the end. SQL> -- You will not get any user-friendly error messages. SQL> set serveroutput on SQL> declare 2 type rec_type is table of test1%rowtype index by binary_integer; 3 x rec_type; 4 begin 5 select * BULK COLLECT INTO x from test1; 6 dbms_output.put_line('--------------'); 7 for i in 1..3 loop 8 dbms_output.put_line(x(i).c1||' '||x(i).c2||' '||x(i).sumc2); 9 end loop; 10 dbms_output.put_line('--------------'); 11 end; 12 / -------------- a 1 100 b 2 400 a 1 135 -------------- PL/SQL procedure successfully completed. SQL> SQL> -- TBALE() function works with SQL, not PL/SQL, collection type. SQL> declare 2 type rec_type is table of test1%rowtype index by binary_integer; 3 type char_type is table of varchar2(2); 4 x rec_type; 5 w char_type; 6 begin 7 select * BULK COLLECT INTO x from test1; 8 select t.c1 BULK COLLECT into w from table(x) t; 9 end; 10 / select t.c1 BULK COLLECT into w from table(x) t; * ERROR at line 8: ORA-06550: line 8, column 44: PLS-00382: expression is of wrong type ORA-06550: line 8, column 38: PL/SQL: ORA-22905: cannot access rows from a non-nested table item ORA-06550: line 8, column 1: PL/SQL: SQL Statement ignored SQL> SQL> create or replace type test2_type as object (c1 varchar2(2), c2 number(1)); 2 / Type created. SQL> create or replace type tab_test2_type as table of test2_type; 2 / Type created. SQL> declare 2 x tab_test2_type; 3 type char_type is table of varchar2(2); 4 w char_type; 5 begin 6 select test2_type(c1,c2) BULK COLLECT into x from test2; 7 select t.c1 BULK COLLECT into w from table(x) t; 8 dbms_output.put_line('--------------'); 9 For i in 1..w.count loop 10 dbms_output.put_line(w(i)); 11 end loop; 12 end; 13 / -------------- b c e K P G ap u PL/SQL procedure successfully completed. SQL> SQL> drop type tab_test2_type; Type dropped. SQL> drop type test2_type; Type dropped. SQL> SQL> spool off