创建触发器错误

时间:2017-12-01 10:08:31

标签: oracle plsql triggers

我正在尝试创建触发器,它会给我Error(27,45): PLS-00049: bad bind variable 'OLD.RECEIVED_COST'错误。我在sourcetarget中拥有相同的列名称。

create or replace TRIGGER test
AFTER DELETE
ON source
FOR EACH ROW
DECLARE
BEGIN
  INSERT INTO target(match_id, ktr_num, order_no, matched_keytrol_amt, RECEIVED_COST)
  VALUES (:OLD.match_id, :OLD.ktr_num, :OLD.order_no, :OLD.MATCHED_KEYTROL_AMT, :OLD.RECEIVED_COST);
END;

表源结构是

MATCH_ID    NUMBER(10,0)    
KTR_NUM NUMBER(10,0)    
ORDER_NO    NUMBER(12,0)
MATCHED_KEYTROL_AMT NUMBER(20,4)    
RECEIVED_COST   NUMBER(20,4)    

目标表结构是

MATCH_ID    NUMBER(10,0)
KTR_NUM NUMBER(10,0)
ORDER_NO    NUMBER(12,0)
MATCHED_KEYTROL_AMT NUMBER(20,4)
RECEIVED_COST   NUMBER(20,4)
SESSION_ID  NUMBER

0 个答案:

没有答案