當(dāng)前位置:
首頁 >
建立触发器
發(fā)布時間:2025/7/14
26
豆豆
create or replace trigger tg_studentafter insert or update or deleteon studentfor each row
declare-- 定義變量
begin--記錄日志的程序--操作類型
case when inserting then insert into log values (sq_log.nextval,'student',sysdate,'對表進(jìn)行了數(shù)據(jù)添加,新數(shù)據(jù)的主鍵='||:new.sno);when updating theninsert into log values (sq_log.nextval,'student',sysdate,'對表進(jìn)行了數(shù)據(jù)的修改,修改數(shù)據(jù)的主鍵='||:old.sno||'新數(shù)據(jù)的主鍵='||:new.sno);when deleting theninsert into log values (sq_log.nextval,'student',sysdate,'對表進(jìn)行了數(shù)據(jù)的刪除,刪除數(shù)據(jù)的主鍵='||:old.sno);end case;end tg_student;
?
轉(zhuǎn)載于:https://www.cnblogs.com/diaozhaojian/p/5977019.html
總結(jié)
- 上一篇: day19_MD5加密_Apache D
- 下一篇: webform(九)——JQuery基础