Re: Trigger to limit number of rows in another table
You'd need Insert & Update Triggers on Table 1, each saying something like ...
declare n smallint;
set n = ( select count(*) from table2 ) - NEW.MaxNumberOfRowsTable2;
if n > 0 then
delete from table2 order by id limit n;
end if;
Subject
Views
Written By
Posted
2220
May 26, 2020 07:53AM
Re: Trigger to limit number of rows in another table
1252
May 26, 2020 09:03AM
1151
May 26, 2020 10:51AM
1020
May 26, 2020 11:20AM
1082
May 26, 2020 12:57PM
1004
May 26, 2020 01:10PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.