create or replace trigger trigger_fbi_buzi_9008_update
  after  INSERT OR UPDATE ON fbi_buzi_9008
  FOR EACH ROW
declare
begin
       if (:new.result_code  = '000000' and :new.buzi_type = '005' and :new.packet_code = '1003' ) then----授权支付 已到账
          update jdcztest.CP_PLAN_AGENT_BILL  t set t.a_status_code = '6'
          where  v_cp_plan_agnet_list.DP_DETAIL_ID = :new.buzi_id  ;
       END IF;
END trigger_fbi_buzi_9008_update;这是我的触发器代码,现在报PL/SQL:ora-00904:“v_cp_plan_agnet_list.DP_DETAIL_ID”:invalid identifier
sql statement ignored 
我的视图是写好了的,现在触发器没法编译通过

解决方案 »

  1.   


    create or replace trigger trigger_fbi_buzi_9008_update
      after  INSERT OR UPDATE ON fbi_buzi_9008
      FOR EACH ROW
    --declare--去掉
    begin
           if (:new.result_code  = '000000' and :new.buzi_type = '005' and :new.packet_code = '1003' ) then----授权支付 已到账
              update jdcztest.CP_PLAN_AGENT_BILL  t set t.a_status_code = '6'
              where  v_cp_plan_agnet_list.DP_DETAIL_ID = :new.buzi_id  ;
           END IF;
    END trigger_fbi_buzi_9008_update;
      

  2.   

    --update jdcztest.CP_PLAN_AGENT_BILL  t set t.a_status_code = '6'
    --          where  v_cp_plan_agnet_list.DP_DETAIL_ID = :new.buzi_id  ;
    这句话是什么意思呢?
    你更新CP_PLAN_AGENT_BILL 表,where的条件却是v_cp_plan_agnet_list表?
    也没有两个表做联合,就会报错。
      

  3.   


    where  v_cp_plan_agnet_list.DP_DETAIL_ID = :new.buzi_id  ;--你的where倏件應該同一個表的字段,怎么搞了另一個表,這個地方應也不對
      

  4.   

    v_cp_plan_agnet_list 是啥东西?
      

  5.   


    --declare--去掉NO.....  DECLARE 要存在而且必须存在.
      

  6.   

    v_cp_plan_agnet_list是一个视图,我应该怎么做联合呢,就是不知道写法,求解答
      

  7.   

    我的update的条件是基于这个视图的dp_detail_id 这个要怎么改呢