0

我在 Java 应用程序中调用 PL/SQL 过程来更新数据库条目。

Connection connection = null;
CallableStatement preparedCall = null;
Integer result = 0;
preparedCall = connection.prepareCall("{ call ? := pkg_temp.update_data(?, ?)}");
preparedCall.registerOutParameter(1, OracleTypes.INTEGER);
preparedCall.setString(2, variable1);
preparedCall.setString(3, cariable2);
result = preparedCall.executeUpdate();

但我在 executeUpdate() 收到以下错误

Caused by: java.sql.SQLException: ORA-06550: line 1, column 11:
PLS-00103: Encountered the symbol "=" when expecting one of the following:
:= . ( @ % ; indicator
ORA-06550: line 1, column 51:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( ) , * % & - + / at mod remainder rem <an exponent (**)>
and or || multiset

我在哪里做错了?

4

1 回答 1

0

:=是错误的,返回参数的占位符必须在关键字之前列出(如 JavaDocs 中所述):call

connection.prepareCall("{?= call pkg_temp.update_data(?, ?)}");
于 2015-09-16T06:02:31.760 回答