PLS-00306: wrong number or types of arguments in call in PL/SQL and JAVA
897014Oct 31 2011 — edited Nov 1 2011Hello and thank you in advance. I'm tring to make the following accept and return an array. However, I can't get past this error:
ORA-06550: line 10, column 19:
PLS-00306: wrong number or types of arguments in call to 'CALLHELLOWORLD'
ORA-06550: line 10, column 5:
PL/SQL: Statement ignored
Please comment and advice! The DBMS is Oracle 11.2.x
Much appreciated!!!!!!
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED ETF."HelloWorld"
AS
import oracle.sql.*;
public class HelloWorld {
public static String test(oracle.sql.ARRAY[] args) {
String msg = "HelloWorld:";
int x=0;
for(oracle.sql.ARRAY arg:args) {
msg += "args[" + x++ + "]:" + arg;
}
return msg;
}
}
/
CREATE OR REPLACE TYPE STRARRAY AS TABLE OF VARCHAR2 (255)
/
CREATE OR REPLACE FUNCTION ETF.callhelloworld ( p_msg_in IN STRARRAY) RETURN STRARRAY
AS LANGUAGE JAVA
NAME 'HelloWorld.test(oracle.sql.ARRAY[]) return oracle.sql.ARRAY ';
/
// test proc
DECLARE
v_buff STRARRAY := STRARRAY();
v_buff2 STRARRAY := STRARRAY();
BEGIN
v_buff.EXTEND;
v_buff(1) := ' from FLorida.';
v_buff2 := etf.callhelloworld (v_buff);
DBMS_OUTPUT.PUT_LINE(v_buff2(1));
END;
I get the following error when calling callhelloworld(v_buff)
ORA-06550: line 10, column 19:
PLS-00306: wrong number or types of arguments in call to 'CALLHELLOWORLD'
ORA-06550: line 10, column 5:
PL/SQL: Statement ignored