I have created object type and its nested table type to hold the values.
Connected to Personal Oracle Database 10g Release 10.2.0.1.0
Connected as hr
SQL>
SQL> create or replace type t_obj as object
2 ( id number,
3 dt date
4 );
5 /
Type created
SQL> create or replace type t_obj_nt is table of t_obj;
2 /
Type created
SQL> set serveroutput on
SQL>
SQL> declare
2 l_tab t_obj_nt;
3
4 begin
5
6 select level,(sysdate+ level) into l_tab
7 from dual connect by level < 5;
8
9 dbms_output.put_line(l_tab.count);
10 end;
11 /
declare
l_tab t_obj_nt;
begin
select level,(sysdate+ level) into l_tab
from dual connect by level < 5;
dbms_output.put_line(l_tab.count);
end;
ORA-06550: line 8, column 3:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 7, column 3:
PL/SQL: SQL Statement ignored
SQL>