create trigger pqp_djfb_ins
after insert on arap_djfb
for each row
begin
update arap_djfb
set zyx1=c.custshortname,zyx2=c.taxpayerid
where arap_djfb.ksbm_cl=bd_cumandoc.pk_cumandoc
and bd_cumandoc.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc
and fb_oid=:new.fb_oid
end;
after insert on arap_djfb
for each row
begin
update arap_djfb
set zyx1=c.custshortname,zyx2=c.taxpayerid
where arap_djfb.ksbm_cl=bd_cumandoc.pk_cumandoc
and bd_cumandoc.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc
and fb_oid=:new.fb_oid
end;
解决方案 »
- 【Oracle安装求助】软件工程学生初次接触数据库
- 只有.DBF、.CTL、.log如何恢复数据库 ORACLE 9i
- 解释:storage (initial 2M next 2M pctincrease 0);
- oracle游标底层的查询机制问题,各位大哥帮帮忙!
- order by的字段不需要select出来,有人知道为什么吗
- 关于sqlplus的小问题
- update set (f1,f2) = (select f1, f2 from table2 ) 如何匹配更新?
- 100分 绝顶高手请进:“Lock”相关的怪问题(ORA8i设置)
- 请教一个sql,怎样写一个结果集不再另一个结果集中的sql
- 求教,如何获取表分区high_value字段里面的时间呢?
- 跪求oracle9.2 的 patch 2428356 补丁用于oracle 的com+支持。[email protected]
- 怎样显示出表结构?
after insert on arap_djfb
for each row
begin
update arap_djfb
set (zyx1,zyx2)=
(select c.custshortname,c.taxpayerid
from arap_djfb a,bd_cumandoc b,bd_cubasdoc c
where a.ksbm_cl=b.pk_cumandoc
and b.pk_cubasdoc=c.pk_cubasdoc)
where fb_oid=:new.fb_oid;
end;
create trigger pqp_djfb_upd
after update of ksbm_cl on arap_djfb
for each row
begin
update arap_djfb
set (zyx1,zyx2)=
(select c.custshortname,c.taxpayerid
from arap_djfb a,bd_cumandoc b,bd_cubasdoc c
where a.ksbm_cl=b.pk_cumandoc
and b.pk_cubasdoc=c.pk_cubasdoc)
where fb_oid=:new.fb_oid
end;
update arap_djfb
set zyx1=bd_cubasdoc.custshortname,zyx2=bd_cubasdoc.taxpayerid
where inserted.ksbm_cl=bd_cumandoc .pk_cumandoc
and bd_cumandoc .pk_cumandoc =bd_cubasdoc.pk_cubasdoc
and arap_djfb.fb_oid=inserted .fb_oid
end
提交的时候提示要填写new变量。
to yujiabian(流氓兔子雨):
提交的时候提示表或视图不存在象触发器中使用到的两个缓冲区:插入区(inserted)和删除区(deleted)在oracle中怎么称呼?
因为时间急,没有太多时间去翻书,希望大侠们帮帮忙。或者提示一下小弟该看什么书快速搞定它。
after update of ksbm_cl on arap_djfb
for each rowv_zxy1 varchar2(20);
v_zyx2 varchar2(20);
begin
if :new.ksbm_cl<>:old.ksbm_cl then
在这里根据你的需要直接对:new.zxy1 ,和:new.zxy2进行更改,不能对本表再进行更新,因为此时表已经变异!
end if;
end;
after update of ksbm_cl on arap_djfb
for each rowv_zxy1 varchar2(20);
v_zyx2 varchar2(20);
begin
if :new.ksbm_cl<>:old.ksbm_cl then
select c.custshortname,c.taxpayerid into v_zyx1,v_zyx2 from bd_cumandoc b,bd_cubasdoc c
where b.pk_cumandoc=:new.ksbm_cl and b.pk_cubasdoc=c.pk_cubasdoc;
:new.zyx1:=v_zyx1;
:new.zyx2:=v_zyx2;
end if;
end;
谢谢各位
结帐