Oracle ORA-00933: SQL command not properly ended?

让人想犯罪 __ 提交于 2019-12-10 18:41:57

问题


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

Error:

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

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>   

回答1:


Please put , between your columns of Set Clause like:

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



回答2:


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

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



回答3:


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.



来源:https://stackoverflow.com/questions/22325809/oracle-ora-00933-sql-command-not-properly-ended

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!