------解决方法--------------------------------------------------------侍?
表象如下:
一、在一个表上有一个触发器,以前一直运行很好,而且正常。现在到十二月份却连续出现问题。触发器都没有任何改动。
二、触发器的工作原理为:当程序修改主表(触发器关联表)的某一字段'after update of sfs on a_yfd'触发器通过运算向另一个表插入运算后的值。
三、错误为插入的值计算错误。
下面为触发器的代码:
create or replace trigger a_fin_hx
after update of sfs on a_yfd
referencing old as old new as new
for each row
declare
s_jsj a_yfd.jsj%type:=:old.jsj;
s_fkzt a_yfd_zt.fkzt%type;
s_khlsh a_yfd.khlsh%type:=:old.khlsh;
s_acc a_wldw.acc_rec%type;
s_send a_wldw.sendedsurplus%type;
t_acc a_wldw.acc_rec%type;
t_send a_wldw.sendedsurplus%type;
t_sfs a_yfd.sfs%type:=:old.sfs;
n_sfs a_yfd.sfs%type:=:new.sfs;
i_lsh a_yfd.lsh%type:=:old.lsh;
s_ysk number(16,6);
s_date date;
ls_date varchar2(30);
n integer;
hxjl_id a_hxjl.lsh%type;
t_hk number(16,6);--a_hxjl.hk%type;
PRAGMA AUTONOMOUS_TRANSACTION;
begin
t_hk:=0;
select trunc(sysdate) into s_date from dual;
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') into ls_date from dual;
select fkzt into s_fkzt from a_yfd_zt where lsh=:old.lsh;
select acc_rec into s_acc from a_wldw where lsh=s_khlsh;
select sendedsurplus into s_send from a_wldw where lsh=s_khlsh;
select count(*) into n from a_hxjl where hxsj=s_date and dwlsh=s_khlsh;