我正在执行以下查询
update ttt_table set
UPDATEDDATE = To_Date('03.03.03 14:29:34.337') WHERE NAME='SSSAAWW';
它显示错误ORA-01843: not a valid month
如果你想要百分之一秒,你必须使用 TO_TIMESTAMP 函数。
update ttt_table set
UPDATEDDATE = To_Timestamp('03.03.03 14:29:34', 'DD.MM.YY HH24:MI:SS') WHERE NAME='SSSAAWW';
TO_DATE 如下所示:
update ttt_table set
UPDATEDDATE = To_Date('03.03.03 14:29:34', 'DD.MM.YY HH24:MI:SS') WHERE NAME='SSSAAWW';
尝试定义日期字符串的格式
update ttt_table
set UPDATEDDATE = To_Date('03.03.03 14:29:34', 'dd.mm.yy hh24:mi:ss') WHERE NAME='SSSAAWW';
Change the To_Date method like this
eg: to_date('2003/07/09', 'yyyy/mm/dd');
in your case : to_date('03.03.03 14:29:34.337', 'yy.mm.dd HH24:MI:SS.FF3')
This should work for your case:
update ttt_table set
UPDATEDDATE = To_Timestamp('03.03.03 14:29:34', 'DD.MM.YY HH24:MI:SS') WHERE NAME='SSSAAWW';