【发布时间】:2016-05-14 23:30:37
【问题描述】:
我在使用 CallableStatement 时遇到了困难,该参数应更改数据库中的所有薪水。
这是程序。 Ratio 不在 Employee 类中。
create or replace PROCEDURE CHANGE_SALARY
(ratio DECIMAL) AS
BEGIN
Update employee SET salary=round(salary/ratio);
end;
找不到如何实施。我需要从“field_getRatio”获取比率并发送到程序以应用所有工资。
String sql = "{call change_salary(?)}";
CallableStatement cStmt = dbConnection.prepareCall(sql);
cStmt.registerOutParameter(1, Types.DECIMAL);
cStmt.execute();
感谢您的所有帮助。
编辑:不知道为什么这篇文章被点赞,但感谢蒂姆,问题已经解决了。
【问题讨论】: