Home > Database > Mysql Tutorial > body text

ORA-01861: 文字与格式字符串不匹配 报错处理

WBOY
Release: 2016-06-07 17:34:33
Original
2915 people have browsed it

创建下面的物化视图报错create materialized view BBBrefresh complete on demandasselect a.vbillcode,b.invname,del.exchdate

创建下面的物化视图报错
create materialized view BBB
refresh complete on demand
as
select a.vbillcode,
b.invname,
del.exchdate
 from AA@AA  a
 inner join BB@BB b on a.id = b.id
left join CC@CC del on a.id = del.id
 where a.dbilldae>='2013-06-15' and a.vdef7 is not null;

报错:
ORA-01861: 文字与格式字符串不匹配
ORA-02063: 紧接着 line (起自 TES)

分析:
通过执行物化视图的查询部分

select a.vbillcode,
b.invname,
del.exchdate
 from AA@AA  a
 inner join BB@BB b on a.id = b.id
left join CC@CC del on a.id = del.id
 where a.dbilldae>='2013-06-15' and a.vdef7 is not null;

仍然报相同的错误,由于这个查询涉及到了四个数据库(三个远程,一个本地),感觉可能是环境不一致问题或者sql执行环境配置问题。

解决
通过在session中设置

alter session set nls_language='AMERICAN';

ALTER SESSION SET NLS_LANGUAGE='SIMPLIFIED CHINESE';

然后发起查询都没有解决问题,那设置一下时间格式试试:

alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';

执行查询sql成功,,没有想到一个时间格式问题会导致语句无法执行,看来什么事情都是可能会发生的。

推荐阅读:

ORA-01172、ORA-01151错误处理

ORA-00600 [2662]错误解决

ORA-01078 和 LRM-00109 报错解决方法

ORA-00471 处理方法笔记

ORA-00314,redolog 损坏,或丢失处理方法

ORA-00257 归档日志过大导致无法存储的解决办法

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!