I have code that call Oracle funqtion:
public Map<String, Object> canRefuse(int val) {
SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)
.withSchemaName("custom")
.withCatalogName("pkg")
.withFunctionName("foo");
SqlParameterSource parameterSource = new MapSqlParameterSource()
.addValue("val", val);
return simpleJdbcCall.execute(parameterSource);
}
but It throws exception:
org.springframework.jdbc.BadSqlGrammarException: CallableStatementCallback; bad SQL grammar [{? = call custom.pkg.foo(?)}] ...
Caused by: oracle.jdbc.OracleDatabaseException: ORA-06503: PL/SQL: Function returned without value ORA-06512: at "custom.pkg", line 1207 ORA-06512: at line 1
I could not find any way to overcome this problem
3