But after I write the following statement, executed, but every time I modify dm_verifydetail or increase dm_verifydetail table, are based on changes in front of the table for the rules to change, for instance, I add a line in the morning, afternoon again add a line of this line will update in the morning, is that I have a problem statement is written?
The create or replace the trigger yfyffp
After the INSERT OR update of Dr On dm_verifydetail
FOR EACH ROW
Declare
PRAGMA AUTONOMOUS_TRANSACTION;
The begin
The update dm_delivbill
The set vdef15='1'
Where cdelivbill_hid in (SELECT a.c delivbill_hid
The FROM dm_verifydetail a
WHERE NOT the EXISTS (SELECT 1
The FROM dm_verifydetail b
WHERE b.t s & gt; A.t s
Group by cdelivbill_hid)
And a. d. r=0);
COMMIT;
The update dm_delivbill
The set vdef15='0'
Where cdelivbill_hid in (SELECT a.c delivbill_hid
The FROM dm_verifydetail a
WHERE NOT the EXISTS (SELECT 1
The FROM dm_verifydetail b
WHERE b.t s & gt; A.t s
Group by cdelivbill_hid)
And a. d. r=1);
COMMIT;
end;
CodePudding user response:
As far as possible or absolutely avoid using a triggerCodePudding user response:
After the INSERT OR update of Dr On dm_verifydetail- & gt;
After the INSERT OR update on dm_verifydetail