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.
|
Then Ithink we should use SQL> select SYSTIMESTAMP from dual; 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; It works. |
本文介绍了如何解决在Oracle数据库中插入包含时区信息的时间戳数据时遇到的ORA-01830错误。通过调整TO_TIMESTAMP函数为TO_TIMESTAMP_TZ函数,并正确设置日期格式模板,成功解决了日期格式不匹配的问题。
360

被折叠的 条评论
为什么被折叠?



