程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle數據庫基礎 >> oracle自帶的幾個觸發器(最簡單觸發器格式)

oracle自帶的幾個觸發器(最簡單觸發器格式)

編輯:Oracle數據庫基礎

--

create or replace trigger MDSYS.sdo_drop_user
after drop on DATABASE
declare
   stmt varchar2(200);
BEGIN
     if dictionary_obj_type = ''USER'' THEN
       stmt := ''DELETE FROM SDO_GEOM_METADATA_TABLE '' ||
               '' WHERE SDO_OWNER = '''''' || dictionary_obj_name || '''''' '';
       EXECUTE IMMEDIATE stmt;
    end if;
end;

---

create or replace trigger SYS.aurora$server$startup after startup on database
call dbms_Java.server_startup

 

-- 

create or replace trigger SYS.JIS$ROLE_TRIGGER$ after drop on database
when (ora_dict_obj_type=''ROLE'')
begin
    sns_context.role_dropped(ora_dict_obj_name);
    http_security_cascade.principal_dropped(ora_dict_obj_name);
  end;

--刪除前備份數據的器

Create Or Replace Trigger YSPJ.T_Bill_reMain_Del
Before delete On bill_remain

FOR EACH ROW

begin
Insert into BILL_REMAIN_TIGER
Values(:old.BILL_REMAINID,:old.BILL_TYPEID,:old.REMAIN_NUM,:old.ADD_TIME,:old.ORG_ID,
:old.STATE,:old.BILL_ID,''刪除記錄'',Sysdate,user);

End;

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved