日期:2014-05-17  浏览次数:20947 次

一个关于触发器的问题.在线等!!!!很急!!!!!!!!!!!
create   or   replace   trigger   zdzxccgc_insert
    before   insert   or   update   on   tbl_trans_inter_log    
    REFERENCING   NEW   AS   NEW   OLD   AS   OLD
    for   each   row
declare
    --   local   variables   here
  sentitycode   varchar2(200);
begin

  sentitycode:=:new.entity_code;        

if   :new.state= '25 '   then
          sp_jobs_data_out(sentitycode|| '.txt ',sentitycode);
          update   tbl_trans_inter_log   set   state= '90 '   where   entity_code=sentitycode;
end   if;           --commit;
--     end   if;        
end   zdzxccgc_insert;

上边是我写的一个触发器.目的是想当向表里插入一条记录时.如果状态是25就执行一个存储过程.执行完成存储过程后就把当前记录的状态改为90.但是存储过程是执行了.UPDATE语句没有效果.不知道为什么?求救高手给指点.


------解决方案--------------------
update tbl_trans_inter_log set state= '90 ' where entity_code=sentitycode;
改为
:NEW.state:= '90 ';