Skip to Main Content

DDL Triggers invoked on DROP COLUMN in 11.2.0.4.0

user10881119Sep 24 2015 — edited Sep 25 2015

Hi,


If you run the following code snippet below the trigger on the table is invoked when a clumn is dropped which had been added after the table creation and has a default value and not null defined. This is behaviour I could only reproduce in Oracle 11.2.0.4.0 but not in 11.2.0.3.0. COuld somebody please help me with this? Is this expected behaviour? How can I drop the column without running the trigger?


CREATE TABLE T (

    DESCRIPTION VARCHAR2(50)

);


INSERT INTO T (DESCRIPTION) VALUES ('asd');


COMMIT;


CREATE OR REPLACE TRIGGER BEFORE_T

  BEFORE INSERT OR DELETE OR UPDATE ON T

    REFERENCING OLD AS OLD NEW AS NEW

    FOR EACH ROW

BEGIN

    RAISE_APPLICATION_ERROR(-20001, 'This trigger should not be invoked!');

END BF_TRANSACTIONS;

/

ALTER TABLE T ADD AMOUNT NUMBER DEFAULT 0 NOT NULL;


ALTER TABLE T DROP COLUMN AMOUNT;

Comments
Post Details
Added on Sep 24 2015
6 comments
321 views