Hello, I am trying to call stored function that returns table of integers. The query I am trying to use is:
{ call ? := SOME_PACKAGE.get_some_ids(?, ?, ?, ?, ?, ?) }
To call function that looks like this:
FUNCTION get_some_ids(one IN INTEGER, two IN INTEGER, three IN INTEGER, four IN INTEGER, five IN INTEGER, six OUT INTEGER) RETURN int_tab;
And I prepare this call as such:
conn.callWithParams(QUERY_GET_CONTRACTS,
new JsonArray()
.addNull()
.add(10).add(10).add(10).add(10).add(10),
new JsonArray()
.add(OracleTypes.ARRAY)
.addNull().addNull().addNull().addNull().addNull()
.add("INTEGER"),
Such approach works fine when I called function that returns ref cursor (of course I used OracleTypes.CURSOR instead).
The code results in following exception:
java.sql.SQLException: Fail to construct descriptor: empty Object name
Let's assume I can't change anything in database. I've tried some tricks with using to 'begin end' constructs but failed miserably. Any clues will be greatly appreciated, thank you!