I have a type abc_type and an array of type abc_table. I am trying to pass an object array to a java function.
create type abc_type authid definer as object
( file_name varchar2(5000),
file_size number,
file_paths varchar2(4000)
);
create type abc_table as table of abc_type;
create or replace and compile java source named "Hello" as
public class Hello
{
public static String world(String str,Array str2)
{
return "Hello world - "+ str;
}
}
/
CREATE OR REPLACE FUNCTION helloworld (
str_in in varchar2,
str2_in in abc_table
)
RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'Hello.world (java.lang.String,oracle.sql.Array) return java.lang.String';
/
declare
str varchar2(200):='def';
zipfiles abc_table:=abc_table();
begin
zipfiles.extend(1);
zipfiles(1) := abc_type('aaa',22,'bbb');
dbms_output.put_line('test:'||helloworld('abc',zipfiles));
end;
/
Everything compiles fine, but I get the error ORA-29541: class .Hello could not be resolved. It works fine if I replace Array type with String/Varchar2.