????1.????д??????????????
????-- ????????????ν????????????
????create table emp2_bak as select * from emp2;
????-- ???????????????????????????(1????)
????alter table emp2_bak add bakTime date;
????alter table emp2_bak add deleted number;
????-- ?????д?????????emp2???????????????????????emp2_bak???У????????????
????create or replace trigger autoBakEmp2
????before delete on emp2
????for each row
????begin
????insert into emp2_bak values(:old.empno??:old.ename??:old.job??:old.mgr??:old.hiredate??:old.sal??:old.comm??:old.deptno??sysdate??1);
????end;
??????????????????棨??????????????????????????????????????????????У???
??????????????????????????????????????????????????????????????????????ζ????????????????????????
????2.?????????????????????
????-- ?????????
????create table emp3_bak as select * from emp3 where 1!=1;
????-- ???????????????????????????????????????id???в???????????????????????????????????У??????????
????create or replace trigger autoBakEmp3
????before delete on emp3
????begin
????insert into emp3_bak (select * from emp3 where emp3.deptno not in(select deptno from emp3_bak));
????end;
???????????????????????????????????
???????????????????????????????????????id??ζ??????????????????????id???????????α????????id?????????