pl sql table declared in the anonymous bloack not being recognized.
875608Sep 13 2011 — edited Sep 14 2011Hi Everyone,
I have a simple situtaion ....but got stuck.
I wanted to pass a pl/sql table to a procedure.
So in my package header i declared a variable like
type v_tbl is table of varchar2(30);
In the package body
the calling procedure is
procedure try3
is
tbl1 v_tbl;
begin
tbl1:=v_tbl('12','34','6','788','3','90','76',' ');
try2(tbl1,8);
end try3;
The called procedure is:
procedure try2(tbl v_tbl, cnt1 number)
is
begin
if tbl.count<>cnt1 then
dbms_output.put_line('error in number of inputs');
return;
end if;
for i in tbl.first..tbl.last loop
dbms_output.put_line(tbl(I));
end loop;
end try2;
This works fine.
But when i try to do the same thing from an anonymous block like below:
declare
type v_tbl is table of varchar2(30);
v_tbl1 v_tbl;
begin
v_tbl1:=v_tbl('1','2','3','4');
SM_CONTROL.PKG_NMEENAKSHI.TRY2(v_tbl1,4);
end;
it gives me an error: wrong number or typeof arguments to procedure try2.
The table type i declared here is not being reciognized.
But the one in package header which is common to both the procedures i being used properly.
can anyone suggest why.
As i need to get my table of values from some other source not my own package.
i hope i explained the question well.
please suggest.
thank you,