CREATE OR REPLACE TRIGGER Time_Check BEFORE
INSERT OR UPDATE OR DELETE
ON EMP
BEGIN
IF TO_NUMBER(TO_CHAR(SYSDATE,’hh24′)) < 10 OR TO_NUMBER(TO_CHAR(SYSDATE,’hh24′)) >= 17 OR TO_CHAR(SYSDATE,’DAY’) = ‘SAT’ OR TO_CHAR(SYSDATE,’DAY’) = ‘SAT’ THEN RAISE_APPLICATION_ERROR (-20004,’YOU CAN ACCESS ONLY BETWEEN 10 AM TO 5 PM ON MONDAY TO FRIDAY ONLY.’);
END IF;
END;
No comments:
Post a Comment