PLS-00382: expression is of wrong type // returning arrays
34277May 18 2007 — edited May 18 2007I've got a questions about sending an array from one function to another. When trying to do this I get the error:
PLS-00382: expression is of wrong type
*** Package 1: ors_lib
Have declared this in the packace:
type parameter_arr is table of varchar2(4000) index by binary_integer;
And created this function:
function ret_array
return parameter_arr
is begin declare
v_array parameter_arr;
begin
v_array(1) := 'test';
return v_array;
end;
end ret_array;
*** Package 2: ors_pub
Have declared this in the package:
type parameter_arr is table of varchar2(4000) index by binary_integer;
And created this procedure:
procedure get_array
is begin declare
v_array parameter_arr;
begin
v_array := ors_lib.ret_array;
end;
end get_array;
Trying to compile package ors_pub I get the error:
101/2 PL/SQL: Statement ignored
101/21 PLS-00382: expression is of wrong type
SQL> 101
101* v_array := ors_lib.ret_array;
What am I doing wrong here? If I return any other pre-defined datatype it works without any problems. Is it impossible to return an own defined "table-array"?