create trigger atrigger
after update of status_flg
on table_a
for each row
when (status_flg='1')
update table_a set status_flg=1 where par_row_id=:new.row_id
after update of status_flg
on table_a
for each row
when (status_flg='1')
update table_a set status_flg=1 where par_row_id=:new.row_id
when (new.status_flg='1')
大虾,救命啊...
然后在表上建立一个语句级触发器,和一个行级触发器。
因为ORACLE中对行级触发器的限制不允许修改变化表,但是对语句级触发器没有限制。
所以在行级触发器中将需要修改的东西存储在Package的变量中,在语句级触发器中读取,
然后修改变化表。
alter table yourtable add column flag number(1) default 0;
当你将status_flg从0改为1时同时也将flag的值修为1.即
update yourtable set status_flg=1,flag=1
更新时使用
update yourtable set status_flg=1 where flag=1;和
update yourtable set flag=0;
在语句级触发器中,update table_a set other_field ='$#' where ...,是可以的;
~~~~~~~~~~~~~~~~~~
但是,update table_a set status_flg ='1' where ...就不行了。
~~~~~~~~~~~~~~~~
因为我的行级触发器when (old.status_flg ='2' and new.status_flg ='3'),大家再帮我
想想办法吧,再20分
这个procedure,别的实在没什么好方法。