
本文共 767 字,大约阅读时间需要 2 分钟。
报错信息:ORA-01830: date format picture ends before converting entire input string
报错sql片段:
is not null and (to_date(字段名,'yyyy-MM-dd')+1) > sysdate
报错原因:数据库中存储有时分秒的数据识别不了
解决:修改sql片段为:is not null and (to_date(字段名,'yyyy-MM-dd HH:mm:ss')+1) > sysdate
-------------------------------------------------------------------------------------
修改后重新查询
报错信息:ORA-01810: format code appears twice
报错原因:Oracle中的日期格式是不区分大小写的,所以 mm 出现了两次
解决:修改sql片段为:is not null and (to_date(字段名,'yyyy-MM-dd HH:mi:ss')+1) > sysdate
-------------------------------------------------------------------------------------
修改后重新查询
报错信息:ORA-01849: hour must be between 1 and 12
报错原因:如果对Oracle语言设置设定为使用12小时的时间,这个问题就会在转换24小时的时间格式时发生。
解决:修改sql片段为:is not null and (to_date(字段名,'yyyy-MM-dd HH24:mi:ss')+1) > sysdate
发表评论
最新留言
关于作者
