【发布时间】:2021-10-03 07:26:29
【问题描述】:
我正在尝试使用 java 调用 oracle 过程。
我正在从用户读取 sql 查询并传递给程序。
所以当我试图将select * from emp where emp_id like 'XX' 作为声明传递时,
该过程以以下错误结束:-
Error Msg = ORA-06550: line 1, column 103:
PLS-00103: Encountered the symbol "XX" when expecting one of the following:
) , * & = - + < / > at in is mod remainder not rem =>
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The symbol ", was inserted before "XX" to continue.
我该如何克服这个???
提前致谢
【问题讨论】:
-
请编辑您的问题以包含您的过程的代码,以及如何从 Java 中调用它。 (如果您还没有处理这种可能性,还建议您阅读 SQL 注入。)
-
你能调试你看不到的代码吗?好吧,我们也不能。请阅读stackoverflow.com/help/minimal-reproducible-example