Java ORA-00907: SQL 中缺少右括号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19120478/
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-08-12 14:17:36 来源:igfitidea点击:
ORA-00907: Missing right parenthesis in SQL
提问by Abhishek
I'm trying to run this SQL query in java
我正在尝试在 Java 中运行此 SQL 查询
String query = "update table_name set refresh_date=to_date('01-SEP-2013','dd-mon-yyyy') where colomn_name like '%my_col%'"
jdbc.execute(query);
I'm getting the error
我收到错误
java.sql.SQLException: ORA-00907: missing right parenthesis
I have looked at other similar questions on stackoverflow but cannot figure out what's wrong here.
我查看了有关 stackoverflow 的其他类似问题,但无法弄清楚这里出了什么问题。
采纳答案by Reimeus
You have some invalid quotes. You need to match them like this
你有一些无效的报价。你需要像这样匹配它们
update table_name set refresh_date=to_date('01-SEP-2013','dd-mon-yyyy') where colomn_name like '%my_col%'
回答by Juned Ahsan
You are using the wrong quotes. Try this:
您使用了错误的引号。尝试这个:
update table_name
set refresh_date=to_date('01-SEP-2013','dd-mon-yyyy')
where colomn_name like '%my_col%'