Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 23 2015
Added on Sep 24 2015
6 comments
606 views