The error: ORA-01830: date format picture ends before converting entire input string..

 

 

 

Got error when they tried to insert data.

Insert into CAM_LOGS (COMMENTS,CREATED_BY,CREATED_TS) values ('INFO:[mess_wellcome_user] start sending email to : ALEXANDRA.TORRES@ORACLE.COM for user 44501','send_mail_users_AI',to_timestamp('08-MAR-11 02.27.35.000000000 PM EUROPE/LONDON','DD-MON-RR HH.MI.SSXFF AM'))
                                                                                                                                                                                                *
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string


Insert into CAM_LOGS (COMMENTS,CREATED_BY,CREATED_TS) values ('INFO:[mess_wellcome_user] start sending email to : MARCOS.FERREIRA@ORACLE.COM for user 44502','send_mail_users_AI',to_timestamp('08-MAR-11 02.27.35.000000000 PM EUROPE/LONDON','DD-MON-RR HH.MI.SSXFF AM'))
                                                                                                                                                                                               *
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string..

I found the data format is not correct on this:

Insert into CAM_LOGS (COMMENTS,CREATED_BY,CREATED_TS) values ('INFO:[mess_wellcome_user] start sending email to : ALEXANDRA.TORRES@ORACLE.COM for user 44501','send_mail_users_AI',to_timestamp('08-MAR-11 02.27.35.000000000 PM EUROPE/LONDON','DD-MON-RR HH.MI.SSXFF AM'))
                                                                                                                                                                                                *
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string


Insert into CAM_LOGS (COMMENTS,CREATED_BY,CREATED_TS) values ('INFO:[mess_wellcome_user] start sending email to : MARCOS.FERREIRA@ORACLE.COM for user 44502','send_mail_users_AI',to_timestamp('08-MAR-11 02.27.35.000000000 PM EUROPE/LONDON','DD-MON-RR HH.MI.SSXFF AM'))
                                                                                                                                                                                               *
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string..
Let us see the details about the fuction of TO_TIMESTAMP.

TO_TIMESTAMP: Converts a character string of CHAR , VARCHAR2 , NCHAR , or NVARCHAR2 datatype to a value of TIMESTAMP datatype

TO_TIMESTAMP_TZ: Converts a character string of CHAR , VARCHAR2 , NCHAR , or NVARCHAR2 datatype to a value of the TIMESTAMP WITH TIME ZONE datatype

 

Then Ithink we should use TO_TIMESTAMP_TZ becasue the data with the TIME ZONE.

SQL> select SYSTIMESTAMP from dual;

SYSTIMESTAMP
---------------------------------------------------------------------------
11-MAR-11 12:22:03.425521 AM -07:00

SQL> select to_timestamp_tz('08-MAR-11 02.27.35.000000000 PM EUROPE/LONDON','DD-MON-RR HH.MI.SSXFF AM tzr') from dual;

TO_TIMESTAMP_TZ('08-MAR-1102.27.35.000000000PMEUROPE/LONDON','DD-MON-RRHH.M
---------------------------------------------------------------------------
08-MAR-11 02:27:35.000000000 PM EUROPE/LONDON

 

It works.

 

 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值