Oracle???????????????
???????????? ???????[ 2016/10/26 10:13:30 ] ?????????????
????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?????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11