Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过Java代码调用Oracle存储过程时出错_Java_Oracle_Stored Procedures_Jdbc_Callable Statement - Fatal编程技术网

通过Java代码调用Oracle存储过程时出错

通过Java代码调用Oracle存储过程时出错,java,oracle,stored-procedures,jdbc,callable-statement,Java,Oracle,Stored Procedures,Jdbc,Callable Statement,我在Java应用程序中调用PL/SQL过程来更新数据库条目 Connection connection = null; CallableStatement preparedCall = null; Integer result = 0; preparedCall = connection.prepareCall("{ call ? := pkg_temp.update_data(?, ?)}"); preparedCall.registerOutParameter(1, OracleTypes.

我在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()上得到以下错误

原因:java.sql.SQLException:ORA-06550:第1行第11列:
PLS-00103:在预期以下情况时遇到符号“=”:
:= . (@%)指标
ORA-06550:第1行第51列:
PLS-00103:在预期以下情况时遇到“;”符号:
.(),*%&-+/
和或| |多集

我哪里做错了?

:=
错误,返回参数的占位符必须列在
调用
关键字()之前:


感谢您的建议。但是更改此语法会导致此错误严重:java.sql.SQLException:ORA-06550:第1行,第13列:PLS-00382:表达式的类型错误ORA-06550:第1行,第7列:PL/sql:语句ignoredWell,这是存储过程内部的错误。您传递的类型错误,或者您的过程依赖于它邪恶的隐式数据类型转换。在任何一种情况下,如果没有看到该过程的完整代码,都无法回答此问题谢谢…我想我找到了问题。我的过程的返回类型是布尔型的。但我在这里将其注册为整数。但是,将out参数注册为OracleTypes.boolean将不起作用。我该怎么办那个
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
connection.prepareCall("{?= call pkg_temp.update_data(?, ?)}");