0
I want to do a Rigger that prohibits any DML operation on a given table. In case these are the parameters: between 20:00 to 06:00, and Sunday all day.
CREATE OR REPLACE TRIGGER TG_HORARIO
BEFORE UPDATE OR DELETE OR INSERT
ON XNOTA
FOR EACH ROW
DECLARE
D_SEMANA INT;
HORA INT;
BEGIN
SELECT TO_CHAR(SYSDATE, 'd') INTO D_SEMANA FROM DUAL;
SELECT TO_CHAR(SYSDATE, 'HH24') INTO HORA FROM DUAL;
IF D_SEMANA <> 7 THEN
IF HORA < 6 AND HORA > 20 THEN
RETURN FALSE;
END IF;
END IF;
END;
NOTE: How should I proceed from the second if?