I have a function which returns array and I am calling this function from java to get the values.
PL/SQL Code
create or replace type dates
is array(10000) of varchar2(32)
function
CREATE OR REPLACE function datefunc (
id1 IN number,
id2 IN NUMBER
)
RETURN dates
AS
datearray dates;
sdate VARCHAR2 (32);
edate VARCHAR2 (32);
BEGIN
Java code
connection = datacon.getConnection();
callablestatement =
connection.prepareCall("begin ? :=datefunc(?,?,?); end;");
callablestatement.registerOutParameter
(1, OracleTypes.ARRAY,"dates");
callablestatement.setInt(2, param1);
callablestatement.setInt(3, param2);
callablestatement.execute();
But when I execute my code I am getting
java.sql.SQLException: invalid name pattern: schema.dates
What could be the reason for this and how can I resolve this error?
Thanks
It had to be in uppercase:
UPDATE: Oh, I found where I saw similar question: https://stackoverflow.com/a/2787880/617455