ORACLE触发器将准备删除的数据插入一张表中,当删除的是单条时可以实现,如果是整张表删怎么实现? 10
以emp表为例,下面的触发器在删除一条数据时可以将准备删除的数据插入emp_back,但当执行deletefromemp时却没有能把数据插入emp_back,请教如何实现...
以emp表为例,下面的触发器在删除一条数据时可以将准备删除的数据插入emp_back,但当执行delete from emp时却没有能把数据插入emp_back,请教如何实现在执行删除整张表数据时,将准备删除的数据插入emp_back。
create or replace trigger dfd_emp
before delete on scott.emp
Referencing Old As Old New As New
For Each Row
BEGIN
insert into scott.emp_back
values
(:old.empno,
:old.ename,
:old.job,
:old.mgr,
:old.hiredate,
:old.sal,
:old.comm,
:old.deptno,
sysdate);
end; 展开
create or replace trigger dfd_emp
before delete on scott.emp
Referencing Old As Old New As New
For Each Row
BEGIN
insert into scott.emp_back
values
(:old.empno,
:old.ename,
:old.job,
:old.mgr,
:old.hiredate,
:old.sal,
:old.comm,
:old.deptno,
sysdate);
end; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询