create or replace trigger trgname
after insert or update or delete on table_info
for each row
declare
cur_update sys_refcursor;
temp_date table_info_temp%rowtype;
begin
open cur_update for select * from table_info where sex='1';
loop
exit when cur_update%notfound;
fetch cur_update into temp_date;
insert into table_info_temp values temp_date;
end loop;
close cur_update;
end;
create table table_info(
xm varchar2(20),
sex varchar2(20),
age varchar2(20));
create table table_info_temp(
xm varchar2(20),
sex varchar2(20),
age varchar2(20));
declare
cur_update sys_refcursor;
temp_date table_info_temp%rowtype;
begin
open cur_update for select * from table_info where sex='1';
loop
exit when cur_update%notfound;
fetch cur_update into temp_date;
insert into table_info_temp values temp_date;
end loop;
close cur_update;
end;