8 Replies Latest reply on Mar 2, 2020 6:30 PM by Glen Conway

    Has anyone else had problem with insert triggers being wiped out when editing table?

    aceinc

      From time to time when using the edit function on a table, triggers previously created and not modified, nor any of the fields associated with the trigger were modified the trigger will be reset to a "null" trigger. The trigger will exist with the same name, but the body of the trigger will be "null".

       

      This particular problem has occurred on various versions of SQLDeveloper. Most recently in 17.3. In this particular case the table was edited, using the SQLDeveloper editor, the only change was to add a field. An insert trigger was set to "null" but an update trigger on the same table was not affected.

       

      I will test with the latest version of SQLDeveloper later today.

       

      Trigger before;

       

      TRIGGER "CLAIMS_PREABS_TREATMENT_INSTRG" BEFORE INSERT ON CLAIMS_PREABS_TREATMENT

      FOR EACH ROW

      BEGIN

        <<COLUMN_SEQUENCES>>

        BEGIN

          IF :NEW.RECORD_ID IS NULL THEN

            SELECT CLAIMS_PREABS_TREATMENT_SEQ.NEXTVAL INTO :NEW.RECORD_ID FROM DUAL;

          END IF;

          :NEW.INSERT_USER := USER;

          :NEW.INSERT_DATE := SYSDATE;

          :NEW.UPDATE_USER := USER;

          :NEW.UPDATE_DATE := SYSDATE;

        END COLUMN_SEQUENCES;

      END;

       

      Trigger after;

       

      TRIGGER CLAIMS_PREABS_TREATMENT_INSTRG BEFORE INSERT ON CLAIMS_PREABS_TREATMENT

      FOR EACH ROW

      BEGIN

        <<COLUMN_SEQUENCES>>

        BEGIN

          NULL;

        END COLUMN_SEQUENCES;

      END;