create or replace aaa(id in number)
as
num number;
begin
select count(*) into num from table1 where sno=id;
if num=0 then
insert into table2(..) values(..);
else
insert into table2 select * from table1 where sno=id;
end aaa;
不知道你是不是这个意思。
as
num number;
begin
select count(*) into num from table1 where sno=id;
if num=0 then
insert into table2(..) values(..);
else
insert into table2 select * from table1 where sno=id;
end aaa;
不知道你是不是这个意思。
在插入把插入的值:New插入到table2其他的类似,很容易实现了!