[英]Oracle 12c AFTER INSERT OR UPDATE TRIGGER
I Have a following trigger, which updates but and rolling back automatically, I'm not finding what is the cause, kindly help. 我有以下触发器,该触发器会更新,但会自动回滚,我找不到原因,请帮忙。
FYI: updating table UDF_DATA has a foreign key reference to CCEX.CUSTOMER triggering table. 仅供参考:更新表UDF_DATA具有对CCEX.CUSTOMER触发表的外键引用。
CREATE OR REPLACE TRIGGER TR_CUSTOMER_PM
AFTER INSERT OR UPDATE ON CCEX.CUSTOMER FOR EACH ROW
DECLARE
i_subscriber_id Number :=3080;
user_xcep EXCEPTION;
PRAGMA EXCEPTION_INIT( user_xcep, -20001 );
pragma autonomous_transaction;
i_syscode ccex.customer.cust_system_code%type;
BEGIN
IF :new.cust_account_number like 'TID%' THEN
i_syscode:= :new.cust_system_code;
update udf_data set value = 'Term'
where subscriber_id = i_subscriber_id
and cust_system_code = i_syscode
and entity_id = '1488_OTA'
and udf_id = '3994_OTA'
and name = 'Primary Manager';
END IF;
EXCEPTION
when others then
raise user_xcep;
END;
/
Since the trigger is in autonomous_transaction
mode, it should close the transaction. 由于触发器处于autonomous_transaction
模式,因此应关闭事务。
Please add commit
just before the exception line. 请在例外行之前添加commit
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.