Home  >  Article  >  Database  >  Oracle 触发器更新基表不同记录所产生的问题

Oracle 触发器更新基表不同记录所产生的问题

WBOY
WBOYOriginal
2016-06-07 17:34:09820browse

因为不想通过后台代码实现,所以想通过Oracle触发器来进行操作更新,但是因为触发器更新基表会产生死锁现象,所以参考网上用 全局

因为不想通过后台代码实现,所以想通过Oracle触发器来进行操作更新,但是因为触发器更新基表会产生死锁现象,,所以参考网上用 全局变量来解决该问题,但是在我的行级触发器中一直报错,不明原因。代码如下:

create or replace package pkg_proinfo_update

as G_process in varchar2;G_id in number;
end ;

CREATE OR REPLACE TRIGGER proparent_process_prochild
before update OF process
ON proinfo
FOR EACH ROW
when (old.proclass='总体项目')
BEGIN
 
 FXYDATA.V_ROW:=:new.process;
  FXYDATA.V_GUID:=:new.guId;

END;

create or replace trigger pkg_proproc_update
after update on proinfo
begin
UPDATE proinfo p SET p.parentstate =pkg_proinfo_update.G_process
 WHERE p.parentguid =  pkg_proinfo_update.G_id;
 end;

推荐阅读:

GoldenGate不使用数据泵完成Oracle-Oracle的双向复制

使用GoldenGate的数据泵进行Oracle-Oracle的单向复制

如何对 Oracle 数据泵(expdp/impdp) 进行 debug

Oracle 数据库导出数据泵(EXPDP)文件存放的位置

Oracle 10g 数据泵分区表的导出

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn