Skip to Main Content

New to Java

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-00306: wrong number or types of arguments in call in PL/SQL and JAVA

897014Oct 31 2011 — edited Nov 1 2011
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2011
Added on Oct 31 2011
1 comment
459 views