原因可能是你的update dl_jxjh_nd_detail set ..... 语句修改了两行记录的值。
你可以这样试一下,把update语句中的where updatewhere 拿出来
select * from dl_jxjh_nd_detail where updatewhere 看一下。

解决方案 »

  1.   

    create or replace trigger tr_dljx_njh_detail_update
      before update on dl_jxjh_nd_detail  
      for each row
    declare
      -- local variables here
      v_parid dl_jxjh_nd_detail.par_id%type;
      v_jan dl_jxjh_nd_detail.jan%type;
      v_feb dl_jxjh_nd_detail.feb%type;
      v_mar dl_jxjh_nd_detail.mar%type;
      v_apr dl_jxjh_nd_detail.apr%type;
      v_may dl_jxjh_nd_detail.may%type;
      v_jun dl_jxjh_nd_detail.jun%type;
      v_jul dl_jxjh_nd_detail.jul%type;
      v_aug dl_jxjh_nd_detail.aug%type;
      v_sep dl_jxjh_nd_detail.sep%type;
      v_oct dl_jxjh_nd_detail.oct%type;
      v_nov dl_jxjh_nd_detail.nov%type;
      v_dec dl_jxjh_nd_detail.dec%type;
      v_total dl_jxjh_nd_master.num%type;
      v_gszb dl_wh_sbxx.gszb%type;
      v_fyzb dl_wh_sbxx.fyzb%type;
      v_sbbh dl_jxjh_nd_master.sbbh%type;
      v_xc dl_jxjh_nd_master.xc%type;
      v_sbxh dl_jxjh_nd_master.sbxh%type;
      v_fy dl_jxjh_nd_master.fy%type;
      v_days dl_jxjh_nd_master.days%type;begin
      v_parid:=:old.par_id;
     dbms_output.put_line(parid);
     
      select sbbh,sbxh,xc into v_sbbh,v_sbxh,v_xc from dl_jxjh_nd_master where dl_jxjh_nd_master.id=v_parid;
      dbms_output.put_line(sbbh);
      dbms_output.put_line(sbxh);
      dbms_output.put_line(xc);
     
     
     
      v_jan:=:new.jan;
      v_feb:=:new.feb;
      v_mar:=:new.mar;
      v_apr:=:new.apr;
      v_may:=:new.may;
      v_jun:=:new.jun;
      v_jul:=:new.jul;
      v_aug:=:new.aug;
      v_sep:=:new.sep;
      v_oct:=:new.oct;
      v_nov:=:new.nov;
      v_dec:=:new.dec;
      
     
      
        /* select dl_wh_sbxx.gszb into gszb from dl_wh_sbxx where dl_wh_sbxx.sbbh=sbbh and dl_wh_sbxx.sbxh=sbxh and dl_wh_sbxx.xc=xc;
        
         select dl_wh_sbxx.fyzb into fyzb from dl_wh_sbxx where dl_wh_sbxx.sbbh=sbbh and dl_wh_sbxx.sbxh=sbxh and dl_wh_sbxx.xc=xc;*/  /*total:=jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov+dec;
      fy:=round(fyzb*total,2);
      days:= round(gszb*total,2);
      
      update dl_jxjh_nd_master set dl_jxjh_nd_master.num=total,dl_jxjh_nd_master.days=days,dl_jxjh_nd_master.fy=fy where dl_jxjh_nd_master.id=parid;*/
    end tr_dljx_njh_detail_update;
    /
      

  2.   

    你试着把变量名改一下,我曾经遇到过这样的事情,ORACLE可能分不出变量与列名,如果你的变量与列名一样的话