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

来源:互联网 发布:微博个性域名怎么修改 编辑:程序博客网 时间:2024/05/21 10:20
解决:Oracle异常ORA-01861:literal does not match format string(字符串格式不匹配)
 
 今天在写update日期格式的时候,老是报一个错。
报错: 
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') 
0 0
原创粉丝点击