【问题标题】:Inserting timestamp in Oracle from asp ( not a valid month)从 asp 中在 Oracle 中插入时间戳(无效月份)
【发布时间】:2013-06-18 18:03:14
【问题描述】:
update users Set USER_ACCOUNT_DIS = to_timestamp('6/18/2013 1:41:05 PM','YYYY-MM-DD HH24:MI:SS') Where user_id='mytestuser'

用于 ODBC 驱动程序的 Microsoft OLE DB 提供程序错误“80004005”

[Oracle][ODBC][Ora]ORA-01843: 月份无效

我从经典 asp 中获取日期为“Now()”,如下所示:

sqlText4="update users " 
                sqlText4=sqlText4 & "Set  USER_ACCOUNT_DIS =  to_timestamp('" & Now()&"','YYYY-MM-DD HH24:MI:SS')  "
                sqlText4=sqlText4 & " Where user_id='"&p_user_id&"'"
                Response.Write sqlText4
                objconnencore.Execute(sqlText4)

【问题讨论】:

    标签: oracle asp-classic


    【解决方案1】:

    to_timestamp() 函数中的格式模板参数错误。

    试试:

    to_timestamp('" & Now()&"','MM/DD/YYYY HH:MI:SS PM')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-22
      • 1970-01-01
      相关资源
      最近更新 更多