作者:iamlaosong
一条的SQL查询语句,执行成功或者报错,与语句无关,却与条件中的值有关,错误是ORA-03113: 通信通道的文件结束,是不是很奇怪,语句如下:
select * from tb_evt_dlv a, tb_jg b,tb_evt_mail_clct c where a.mail_num=c.mail_num and a.dlv_date between to_date('2014-11-1','yyyy-mm-dd') and to_date('2014-11-1','yyyy-mm-dd') and a.dlv_sts_code='I' and a.dlv_bureau_org_code =b.zj_code and a.dlv_bureau_org_code like '23009201%' order by b.city,b.ssxs,b.zj_code,a.dlv_date
错误如下图一,关闭图一,出现图二:
这个错误肯定与通信没有关系,这个错误以前也碰到过,当时条件是“23007300”,这个机构依然报错,不过只在关联sncn_zd_jg这个表时报错,现在又发现“23009201”也报错,比那个还严重,更换机构表tb_jg和sncn_zd_jg都报错(参见:一个奇怪的查询语句(不知原因)),很是奇怪。
将‘23009201%’改成‘230092%’,或者直接将like ‘23009201%’换成=‘23009201’都可以成功执行。如下:
select * from tb_evt_dlv a, tb_jg b,tb_evt_mail_clct c where a.mail_num=c.mail_num and a.dlv_date between to_date('2014-12-10','yyyy-mm-dd') and to_date('2014-12-10','yyyy-mm-dd') and a.dlv_sts_code='I' and a.dlv_bureau_org_code =b.zj_code and a.dlv_bureau_org_code = '23009201' order by b.city,b.ssxs,b.zj_code,a.dlv_date
去掉最后一个表,改成下面的语句也可以成功执行。如下:
select * from tb_evt_dlv a, tb_jg b where a.dlv_date between to_date('2014-12-10','yyyy-mm-dd') and to_date('2014-12-10','yyyy-mm-dd') and a.dlv_sts_code='I' and a.dlv_bureau_org_code =b.zj_code and a.dlv_bureau_org_code like '23009201%' order by b.city,b.ssxs,b.zj_code,a.dlv_date
按照以前的经验,用下面语句重新创建tb_jg和sncn_zd_jg,上述错误不再出现。
rename tb_jg to tb_jg1; create table tb_jg as select * from tb_jg1;
只是依然不知原因何在?难道这些表是亚健康?或者是增加这两天记录时留下了什么暗疾?