Write PL/SQL block to create a trigger to update the records according to working days that is you can not update record in holidays
update a
set d = (
select min(next_day) from (
select h, h + 1 day as next_day from holiday where h >= '2020-04-30'
) x where next_day not in (select h from holiday where h >= '2020-04-30')
)
Assuming that you have created the following:
-- create table a (d date);
-- insert into a (d) values ('2020-01-01');
-- create table holiday (h date);
-- insert into holiday (h) values ('2020-05-01');
-- insert into holiday (h) values ('2020-05-02');
-- insert into holiday (h) values ('2020-05-03');
Comments
Leave a comment