create or replace trigger ATOB after insert or update on A for each row
begin
if inserting then
insert into b values(:new.col1,:new.col2,...,:new.coln);
else
update b set (col1,col2,...,coln)=(select :new.ccol1,:new.col2,...,:new.coln from dual)
where 关联字段=:old.关联字段;
end if;
end;
begin
if inserting then
insert into b values(:new.col1,:new.col2,...,:new.coln);
else
update b set (col1,col2,...,coln)=(select :new.ccol1,:new.col2,...,:new.coln from dual)
where 关联字段=:old.关联字段;
end if;
end;
解决方案 »
- 怎么查出连续上班的的天数
- 【不耻下问】SQL语句中的=和in,exists及<>和not in,not exists等连接字的执行速度问题?
- Oracle批量插入数据问题,在线等
- 数据库DBA高手快来啊,linux shell编程 从文本文件读取行和列内容 插入数据库,要怎么读取出来
- procedure function 区别,如何在pl/sql developer中运行他们
- 把一个字段的记录分为三段,这样每段记录为4个,我想将这三段记录分别插入到视图中三个字段,但是为什么三个字段的记录不对齐?错开了,急急!!!
- 请教高手,优化sql!!
- ora-00161 用System.Transactions
- 怎么在存储过程中定义数组?利用数组存储变量,又没有简单的循环的例子?
- update 问题谁来帮我看看。
- 一个很急,但比较简单的问题!
- 外部表的问题(50)
没有这样的用法吗?:new.*
请问楼上大哥知道其中含义吗
create table tableb as select * from tableA where 0=1;
为什么要
update b set (col1,col2,...,coln)=
(select :new.ccol1,:new.col2,...,:new.coln from dual)
不能直接
update b set (col1,col2,...,coln)=
(:new.ccol1,:new.col2,...,:new.coln)
还有什么写法啊?