I am trying to call a oracle function that takes one varchar input argument and returns a varchar. But it throws the following error. I have tried changing the type from varchar to nvarchar in Java but it did not help.
java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'GET_DATA_TEST'
PLSQL function definition
create or replace FUNCTION Get_Data_test (p_acct callid)
RETURN VARCHAR2
AS
Java function:
String call = "{ ? = call Get_Data_test(?)}";
CallableStatement cstmt = con.prepareCall(call);
cstmt.setQueryTimeout(1800);
cstmt.registerOutParameter(1, oracle.jdbc.OracleTypes.VARCHAR);
cstmt.setString(2, "12345678");
cstmt.executeQuery();
name = cstmt.getString(1);
System.out.println("hello: "+name);