出力パラメーターが 1 つしかなく、入力パラメーターがないストアド プロシージャを呼び出そうとしています。以下に示すようにストアド プロシージャを呼び出すと、"wrong number or types of arguments in call to" エラーが発生します。
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(springTemplate)
.withCatalogName("my_package").withProcedureName("my_procedure")
.withReturnValue().withoutProcedureColumnMetaDataAccess()
.declareParameters(new SqlOutParameter("return", Types.VARCHAR));
Map out = jdbcCall.execute();
System.out.println((String)out.get("return"));
ここで何が問題なのかわかりません。エラーが発生します
org.springframework.jdbc.BadSqlGrammarException: CallableStatementCallback;
bad SQL grammar [{? = call my_package.my_procedure()}]; nested exception is
java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'my_procedure'
ORA-06550: line 1, column 7:
PL/SQL: ステートメントは無視されました