---
title: "触发器"
author: "kasuqi"
date: "2010-11-18T18:43:42Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2010-11-18T18:43:42Z"
id: 815357
url: "https://kasuqi.iteye.com/blog/815357"
---

```
CREATE OR REPLACE TRIGGER CustamMi_triggers
  AFTER DELETE OR INSERT OR UPDATE ON epifa_custammi_info
  FOR EACH ROW
DECLARE
BEGIN
  IF INSERTING THEN
    DBMS_OUTPUT.PUT_LINE('记录已经成功插入，并已记录到日志');
    UPDATE goods_base_info@b
       set goods_base_info.id@b = :NEW.CUSTAMID
     where goods_base_info.goods_id@b = :NEW.goodsid;
  END IF;
END;




create or replace trigger trigger_bankcard
  before update on ord_bankcard_info_aa
  for each row
declare
begin

  insert into ord_bankcard_info_aa
  
    (bankcardid,
     bankaccount,
     accounttype,
     accountname,
     identityid,
     status,
     shopid,
     sitetype,
     createtime,
     updatetime,
     shopname,
     areacode,
     bankid,
     flag)
  values
    (:NEW.bankcardid,
     :NEW.bankaccount,
     :NEW.accounttype,
     :NEW.accountname,
     :NEW.identityid,
     :NEW.status,
     :NEW.shopid,
     :NEW.sitetype,
     :NEW.createtime,
     :NEW.updatetime,
     :NEW.shopname,
     :NEW.areacode,
     :NEW.Bankid,
     :NEW.FLAG);

END;
```