タイプ abc_type とタイプ abc_table の配列があります。オブジェクト配列を Java 関数に渡そうとしています。
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;
/
すべて正常にコンパイルされますが、エラーORA-29541: class .Hello could not be resolve が発生します。Array 型を String/Varchar2 に置き換えるとうまくいきます。