Ora Error
ORA-01830 date format picture ends before converting entire input string
Cause: A valid date format picture included extra data. The first part of the format picture was converted into a valid date, but the remaining data was not required.
Action: Check the specifications for date format pictures and correct the statement.
场景重现:
从Excel中复制了年/月/日 时:分:秒的文本数据到数据库,字段数据类型是varchar2,试图转成年-月-日的格式
首先使用了to_date(‘yyyy-mm-dd‘)的方法,报了ORA-01830
解决办法:to_date(‘yyyy/mm/dd‘)
1.在使用spool导出数据文件时,常使用‘|‘或者‘,’作为字段的分隔符,记得字段别加上别名
原文地址:https://www.cnblogs.com/MoreDrinkHotWater/p/8782664.html
时间: 2024-10-27 11:46:20