PL/SQL Trigger to Restrict User to Make Changes on Sunday

PL/SQL Trigger to Restrict User to Make Changes on Sunday :

create or replace trigger restrict
before update or delete or insert
on student
for each row
declare
curr_day varchar(20);
begin
select to_char(sysdate,'day') into curr_day from dual;
if(curr_day < 'monday' and curr_day > 'saturday') then
raise_application_error(-20000,'Changes not allowed on Sunday');
end if;
end;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.