Reputation: 1717
I want to call a stored procedure in Spring Boot using JdbcTemplate.
In my Oracle DB:
CREATE OR REPLACE PACKAGE BODY P_MENU AS
..
procedure menusVegans
is
..
END;
from my Java application. I've tried
jdbcTemplate.update("call P_MENU.menusVegans");
and
jdbcTemplate.execute("P_MENU.menusVegans");
and
jdbcTemplate.execute("call P_MENU.menusVegans");
and
jdbcTemplate.execute("execute call P_MENU.menusVegans");
and
SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)
.withProcedureName("P_MENU.menusVegans");
simpleJdbcCall.execute(null);
all with errors.
Upvotes: 0
Views: 2569
Reputation: 167842
Rather than using
call P_MENU.menusVegans
You should use an anonymous PL/SQL block:
BEGIN P_MENU.menusVegans; END
Upvotes: 1