You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a view has BEFORE/AFTER DELETE triggers and returns multiple rows, and DELETE statement is run against this view with expectation to affect multiple rows, view triggers may be executed just one time instead of per-record.
Test case:
create table t (id int);
create view v as select id from t;
create table log (txt varchar(10));
set term ^;
create trigger trg for v before delete as begin insert into log values ('deleted'); end^
set term ;^
insert into t values (1);
insert into t values (2);
commit;
select count(*) from t;
COUNT
=====================
2
select count(*) from v;
COUNT
=====================
2
delete from v;
select * from log;
TXT
==========
deleted
-- Should be two records!
The text was updated successfully, but these errors were encountered:
If a view has BEFORE/AFTER DELETE triggers and returns multiple rows, and DELETE statement is run against this view with expectation to affect multiple rows, view triggers may be executed just one time instead of per-record.
Test case:
The text was updated successfully, but these errors were encountered: