Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLS-00382: expression is of wrong type // returning arrays

34277May 18 2007 — edited May 18 2007
I'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"?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2007
Added on May 18 2007
9 comments
1,321 views