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
我的视图是写好了的,现在触发器没法编译通过
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
我的视图是写好了的,现在触发器没法编译通过
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;
-- where v_cp_plan_agnet_list.DP_DETAIL_ID = :new.buzi_id ;
这句话是什么意思呢?
你更新CP_PLAN_AGENT_BILL 表,where的条件却是v_cp_plan_agnet_list表?
也没有两个表做联合,就会报错。
where v_cp_plan_agnet_list.DP_DETAIL_ID = :new.buzi_id ;--你的where倏件應該同一個表的字段,怎么搞了另一個表,這個地方應也不對
--declare--去掉NO..... DECLARE 要存在而且必须存在.