|
Blocca modifiche nel weekend Ecco a voi il codice per un comodo trigger che impedisca che vengano apportate delle modifiche su una data tabella nel week-end, ovviamente modificando la descrizione del giorno č possibile mettere tale blocco su altri tipo di giorni della settimana. CREATE OR REPLACE TRIGGER "interruzione_weekend"
BEFORE UPDATE OR INSERT OR DELETE ON "miaTabella"
DECLARE
WEEKEND_ERROR EXCEPTION;
BEGIN
IF TO_CHAR (SYSDATE, 'DAY')) = 'SABATO' OR TO_CHAR (SYSDATE, 'DAY')) = 'DOMENICA' THEN
RAISE WEEKEND_ERROR;
END IF;
EXCEPTION
WHEN WEEKEND_ERROR THEN
RAISE_APPLICATION_ERROR (-20001, 'modifiche vietate nel weekend');
END;
|
|