问题描述
我正在尝试通过 Java 执行我的查询,如下所示:
I am trying to execute my query through Java like this:
然后我在类中调用execSumStatement:
Then i call execSumStatement in the class:
当我运行它时,我收到以下错误消息:
When I run it I get the following error message:
java.sql.SQLDataException: ORA-01830: 日期格式图片在转换整个输入字符串之前结束
java.sql.SQLDataException: ORA-01830: date format picture ends before converting entire input string
当我在 SQL Developer 中执行相同的查询时,它工作得很好.我已经在互联网上进行了搜索,我猜问题是查询中日期的数据类型,应该是日期,但是我尝试的一切都不起作用......
When I execute the same query in SQL Developer it works just fine. I already made a search over the internet, and I guess the problem is the datatype of the date in the query, which should be Date, but everything I tried didn't work...
我是编程的初学者,所以如果你能尽可能简单地解释它会很棒!提前致谢!
I'm a beginner in programming so it would be great if you could explain it as simple as possible! Thanks in advance!
推荐答案
我认为你不应该依赖隐式转换.这是一个不好的做法.
I think you should not rely on the implicit conversion. It is a bad practice.
相反,您应该像这样尝试:
Instead you should try like this:
或者喜欢
这篇关于ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!