日期:2014-05-16  浏览次数:20585 次

解决:Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)

 今天在写存储过程的时候,老是报一个错。如下,记录下来,以供日后查阅。

报错: 

Oracle 异常 ORA-01861: literal does not match format string(字符串格式不匹配)
原因:

如果直接按照字符串方式,或者,直接使用'2013-2-26 11:07:25',没有指定日期格式,就会报错

正解:
必须指定日期格式,如下:
to_date('2013-2-26 11:07:25' , 'yyyy-mm-dd hh24:mi:ss')



我的异常网推荐解决方案:oracle存储过程,http://www.aiyiweb.com/oracle-develop/177537.html