一个“ORA-01403: no data found”的问题

Tags: SQL Server

 

下面这段SQL,以前一直运行好好的,今天突然执行就出错了:

----------------------------------------------------------------------------------

select b.ScheduleDate 日期,

       b.ScheduleName 工班,

       g.WorkGroup 班组,

       d.ChineseName 船名,

       c.Atb 实际靠泊时间,

       c.Atd 实际离泊时间,

       case e.SlType when 'L' then '支线' when 'Z' then '干线'

                     when 'D' then '内支' when 'M' then '内贸' end 航线类型,

       a.LoadNum + a.UnloadNum + a.DowelNum + a.CarbinNum 工班作业量,

       a.ShiftRate 工班单机效率,

       f.LoadNum + f.UnloadNum + f.DowelNum + f.CarbinNum 整船作业量,

       f.Duration / 3600.0 整船作业时间,

       f.QcGrossRate 整船毛效率,

       f.QcRate 整船单机效率,

       DATEDIFF(second, c.Atb, c.Atd) / 3600.0 整船在泊时间,

       f.BerthRate 在泊效率,

       h.Name 控制员,

       j.Name 督导员,

       DATEDIFF(minute,c.Atb,i.workstarttime) 等开工时间,

       DATEDIFF(minute,i.atc,c.Atd) 等离泊时间,

       a.Duration / 3600.0 工班作业毛时间,

       (a.Duration-a.DurationD)/3600.0 工班作业时间,

       round(countsum / (a.Duration / 3600.0),3) 工班毛效率

  from tos.V_VesselShift a, tos.ShiftSchedule b, tos.VesselSchedule c, tos.Vessel d, tos.ShipRoute e, tos.V_Vessel f, tos.VesselShift g, tos.Employee h

  ,(select VESSELBERTHPLANNO,SUPERVISORUSID,workstarttime,atc,WGTYPE,shiftdate

from openquery(TOSMIRRORSITE,'   select Round(s.VESSELBERTHPLANNO) VESSELBERTHPLANNO,Round(s.SUPERVISORUSID) SUPERVISORUSID,

     (case when nvl(instarttime,sysdate)<=nvl(outstarttime,sysdate) then instarttime else outstarttime end)workstarttime

   ,v.atc,w.WGTYPE,trunc(s.shiftdate) shiftdate

    from  vesselshiftsettle s,vesselberthplan v,Workgroupset w

   where s.VESSELBERTHPLANNO=v.VESSELBERTHPLANNO

   and s.WGID=w.WGID') ) i,tos.Employee j

 where a.ShiftScheduleId = b.ShiftScheduleId

   and a.VesselScheduleId = c.VesselScheduleId

   and c.VesselName = d.VesselName

   and c.RouteId = e.RouteId

   and a.VesselScheduleId = f.VesselScheduleId

   and a.ShiftScheduleId = g.ShiftScheduleId

   and a.VesselScheduleId = g.VesselScheduleId

   and g.Controller1 = h.EmployeeId

 

   and i.VESSELBERTHPLANNO=c.VesselScheduleId

   and i.WGTYPE=b.ScheduleName

   and i.SUPERVISORUSID=j.EmployeeId

   and b.ScheduleDate=i.shiftdate

 

 

   and b.ScheduleDate >='20110601'

   and b.ScheduleDate <= '20110602'

 order by b.ScheduleDate,c.Atb

----------------------------------------------------------------------------

 

报错信息如下:

----------------------------------------------------------------------------

链接服务器"TOSMIRRORSITE"的 OLE DB 访问接口 "OraOLEDB.Oracle" 返回了消息 "ORA-01403: no data found"。

Msg 7346, Level 16, State 2, Line 1

无法从链接服务器 "TOSMIRRORSITE" 的 OLE DB 访问接口 "OraOLEDB.Oracle" 获取行的数据。

-----------------------------------------------------------------------------

1 Comment

Add a Comment