create table STU
(
STUNO NUMBER(5) not null,
STUNAME VARCHAR2(18),
STUAGE NUMBER(2)
)
create table UPDATE_STU
(
STUNO NUMBER(5),
STUNAME VARCHAR2(18),
STUAGE NUMBER(2)
)
create or replace trigger before_update_stu
before update on stu
for each row
begin
insert into update_stu values(:old.stuno,:old.stuname,:old.stuage);
end;
create or replace trigger after_update_stu
after update on stu
for each row
begin
insert into update_stu values(:old.stuno,:old.stuname,:old.stuage);
end;
create or replace trigger after_insert_stu
after insert on stu
for each row
begin
insert into update_stu values(:new.stuno,:new.stuname,:new.stuage);
end;
create or replace trigger after_delete_stu
after delete on stu
for each row
begin
insert into update_stu values(:old.stuno,:old.stuname,:old.stuage);
end;
阅读(1086) | 评论(0) | 转发(0) |