Re: Trigger to limit number of rows in another table
Sure ...
declare n smallint;
set n = ( select count(*) from table2 ) - NEW.MaxNumberOfRowsTable2;
if n > 0 then
insert into table3
select * from table2
order by id limit n;
delete from table2
order by id limit n;
end if;
Subject
Views
Written By
Posted
2083
May 26, 2020 07:53AM
1117
May 26, 2020 09:03AM
1030
May 26, 2020 10:51AM
Re: Trigger to limit number of rows in another table
914
May 26, 2020 11:20AM
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.