Restrict the employee to use emp table on saturday and Sunday

Pranat
0

 CREATE OR REPLACE TRIGGER emp_trigger 

BEFORE INSERT OR DELETE OR UPDATE ON employee1

DECLARE

v_day varchar(30):=TO_CHAR(sysdate,’dy’);

BEGIN

IF v_day IN ('sat','sun')

THEN 

RAISE_APPLICATION_ERROR (-20501,'You may Access

EMPLOYEES table only during business hours.');

END IF;

END;

/

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !