oracle怎样用触发器将一张表的数据添加到另外一张表中, 5
展开全部
好吧,我就假设你两个表的数据结构相同吧
create table TabA
(
address varchar2(50),
press varchar2(50),
city varchar2(50)
)
/
create table TabB
(
address varchar2(50),
press varchar2(50),
city varchar2(50)
)
/
create or replace trigger addData
after insert
on tabA
begin
insert into tabB select * from tabA;
end
插入测试语句
insert into tabA values ('123','123','123');
可直接复制代码
create table TabA
(
address varchar2(50),
press varchar2(50),
city varchar2(50)
)
/
create table TabB
(
address varchar2(50),
press varchar2(50),
city varchar2(50)
)
/
create or replace trigger addData
after insert
on tabA
begin
insert into tabB select * from tabA;
end
插入测试语句
insert into tabA values ('123','123','123');
可直接复制代码
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询