Hi,
I am getting an
ORA-00902: invalid datatype error when I am trying call the below function from a select statement. Here I am trying to get a table out from a function.
create or replace package pkg10
as
type tabletype1 is table of table1%rowtype
index by binary_integer;
function func1 return tabletype1;
end pkg10;
create or replace package body pkg10
as
function func1 return tabletype1
is
v_tab1 tabletype1;
idx integer;
begin
idx := 1;
for i in (select * from table1)
loop
v_tab1(idx).name1 := i.name1;
v_tab1(idx).key := i.key;
idx := idx+1;
end loop;
return v_tab1;
end func1;
end pkg10;
select * from table(pkg10.func1);
Please point me out on where I am going wrong.
Thanks