CREATE OR REPLACE TRIGGER SCARTO_RICHIESTE_NOVE
BEFORE INSERT ON MNP_GESTIONE_RICHIESTA
REFERENCING NEW AS new
FOR EACH ROW
WHEN (
new.STATO = 1 AND new.CODICE_OPERATORE_DON_EFF = 'NOVE'
      )
BEGIN
    :new.STATO := 8;
    :new.DA_INVIARE := -1;

  EXCEPTION
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END SCARTO_RICHIESTE_NOVE;
/

CREATE OR REPLACE TRIGGER SCARTO_RICHIESTE_NOVE_OUT
BEFORE INSERT ON MNP_MVNO_NOT_SLA_DON_OUT
REFERENCING NEW AS new
FOR EACH ROW
WHEN (
new.CODICE_OPERATORE_DONATING = 'NOVE'
      )
BEGIN
    :new.DA_SCODARE := 0;

  EXCEPTION
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END SCARTO_RICHIESTE_NOVE_OUT;
/