date format picture ends before converting entire input string
生活随笔
收集整理的這篇文章主要介紹了
date format picture ends before converting entire input string
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
select “TO_DATE”(‘2023/02/02 00:00:00’, ‘yyyy/mm/dd’) from dual
報錯ORA-01830: date format picture ends before converting entire input string
錯誤產生原因:date類型不能包含秒以后的精度。
2023-02-02 17:50:20在使用to_date() 函數時有可能出現此錯誤
解決辦法:
to_date(‘2023-02-02 17:50:20’,‘yyyy-mm-dd’) 是錯誤的
使用instr() 函數配合使用,例如:
to_date( substr('2022-02-02 00:00:00',0,INSTR('2022-02-02 00:00:00', ':', 1, 1)-3),'yyyy-mm-dd')是正確的
總結
以上是生活随笔為你收集整理的date format picture ends before converting entire input string的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: systemd工具介绍
- 下一篇: 佛的平淡生活