特急问题:高手帮忙呀!请看触发输出!!!!
create or replace trigger tr_dljx_njh_detail_update
before update on dl_jxjh_nd_detail
for each row
declare
-- local variables here
parid dl_jxjh_nd_detail.par_id%type;
jan dl_jxjh_nd_detail.jan%type;
feb dl_jxjh_nd_detail.feb%type;
mar dl_jxjh_nd_detail.mar%type;
apr dl_jxjh_nd_detail.apr%type;
may dl_jxjh_nd_detail.may%type;
jun dl_jxjh_nd_detail.jun%type;
jul dl_jxjh_nd_detail.jul%type;
aug dl_jxjh_nd_detail.aug%type;
sep dl_jxjh_nd_detail.sep%type;
oct dl_jxjh_nd_detail.oct%type;
nov dl_jxjh_nd_detail.nov%type;
dec dl_jxjh_nd_detail.dec%type;
total dl_jxjh_nd_master.num%type;
gszb dl_wh_sbxx.gszb%type;
fyzb dl_wh_sbxx.fyzb%type;
sbbh dl_jxjh_nd_master.sbbh%type;
xc dl_jxjh_nd_master.xc%type;
sbxh dl_jxjh_nd_master.sbxh%type;
fy dl_jxjh_nd_master.fy%type;
days dl_jxjh_nd_master.days%type;
begin
parid:=:old.par_id;
dbms_output.put_line(parid);
select dl_jxjh_nd_master.sbbh into sbbh from dl_jxjh_nd_master where dl_jxjh_nd_master.id=parid;
dbms_output.put_line(sbbh);
select dl_jxjh_nd_master.sbxh into sbxh from dl_jxjh_nd_master where dl_jxjh_nd_master.id=parid;
dbms_output.put_line(sbxh);
select dl_jxjh_nd_master.xc into xc from dl_jxjh_nd_master where dl_jxjh_nd_master.id=parid;
dbms_output.put_line(xc);
jan:=:new.jan;
feb:=:new.feb;
mar:=:new.mar;
apr:=:new.apr;
may:=:new.may;
jun:=:new.jun;
jul:=:new.jul;
aug:=:new.aug;
sep:=:new.sep;
oct:=:new.oct;
nov:=:new.nov;
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;
输出结果:
62
10003
0.4
小修
62
10003
0.4
小修
oracle报错:
实际返回行数超出请求的行数;为什么会出现2次输出,像是在做循环,怎样解决?跟for each row有无关系?