create or replace TRIGGER OTIMIZADOR_CENARIO_A_PUBLICAR
AFTER INSERT OR UPDATE ON "CENARIOCARD" FOR EACH ROW

BEGIN
   IF :NEW.NRCENARIOCARDORIGINAL IS NOT NULL THEN
      UPDATE ITGERACAOCARD
      SET NRCENARIOPUBLICAR = :NEW.NRCENARIOCARD
      WHERE NRCENARIOCARD = :NEW.NRCENARIOCARDORIGINAL;
   END IF;
END;
/