When I try to compile the procedure with collection type as in parameter, I'm getting the error like
wrong number or types of arguments in call to 'P_AA'
-------Procedure created with in parameter as nested table------------
create or replace procedure p_aa(serv in t45)
is
aa serv_item%rowtype;
begin
for i in 1..serv.count
loop
select a.* into aa from serv_item a where a.serv_item_id = serv(i);
dbms_output.put_line('Serv item '||aa.serv_item_id||' '||'status '||aa.status);
end loop;
end;
/
----------Calling the package----------
declare
type t1 is table of number;
cursor c1 is select serv_item_id from serv_item;
n number:=0;
v t1;
begin
open c1;
loop
fetch c1 into v(n);
exit when c1%notfound;
n:=n+1;
end loop;
close c1;
p_aa(v);
end;
/
How can I fix my code?