【问题标题】:getting error ORA-01861: literal does not match format string得到错误 ORA-01861: 文字与格式字符串不匹配
【发布时间】:2014-09-30 06:48:33
【问题描述】:

我使用了代码update football_team set DOB='1991-06-07' where id=1;,但它给出了错误

ORA-01861: 文字与格式字符串不匹配

【问题讨论】:

  • 可以添加表格描述吗? DOB 是日期类型吗?

标签: sql oracle


【解决方案1】:

试试这个方法:

update football_team 
set DOB=TO_DATE('1991-06-07', 'yyyy-mm-dd') 
where id=1;

【讨论】:

    【解决方案2】:

    这是因为日期格式字符串不正确
    尝试关注

    update football_team set DOB=TO_DATE('1991/06/07','yyyy/mm/dd') where id=1;
    

    或您的自定义格式

    【讨论】:

      猜你喜欢
      • 2014-04-27
      • 1970-01-01
      • 2017-08-24
      • 2016-04-02
      • 2015-01-11
      • 2010-11-26
      • 2012-10-09
      相关资源
      最近更新 更多