Oracle ORA-00933:SQL 命令未正确结束?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22325809/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 01:19:39  来源:igfitidea点击:

Oracle ORA-00933: SQL command not properly ended?

sqleclipseoraclesql-updateora-00933

提问by user3543466

I keep getting this error.
How do I solve this problem?

我不断收到此错误。
我该如何解决这个问题?

Error:

错误

java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

java.sql.SQLSyntaxErrorException: ORA-00933: SQL 命令未正确结束

Code:

代码

<update id="updateProc" parameterClass="rating">
 update rating set
 rating_title=#rating_title#
 rating_cont=#rating_cont#
 where mem_id=#mem_id# 
 and rating_code=#rating_code#         
</update>   

回答by 124

Please put ,between your columns of SetClause like:

请放在,您的Set条款栏之间,例如:

update rating set rating_title=#rating_title#, rating_cont=#rating_cont#
where mem_id=#mem_id# and rating_code=#rating_code#

回答by Mureinik

In Oracle, string literals are denoted by single quotes ('). So, if you plan to use literals:

在 Oracle 中,字符串文字由单引号 ( ') 表示。因此,如果您打算使用文字:

UPDATE rating 
SET    rating_title='rating_title', rating_cont='rating_cont' 
WHERE  mem_id='mem_id' AND rating_code='rating_code'

回答by James Drinkard

You can also get this exact same error if you have quotes that are not properly closed or you forget to use double quotes inside of a statement with single quotes on the outside.

如果您的引号没有正确关闭,或者您忘记在语句内部使用双引号,而在外部使用单引号,您也会得到完全相同的错误。