1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Triggers

Discussion in 'SQL PL/SQL' started by manoj.vajpee, Dec 18, 2014.

  1. manoj.vajpee

    manoj.vajpee Active Member

    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    110
    How many triggers are you created?How many triggers created on one table?How to disable all triggers in a table?
    Which will fire default first statement level or row level trigger?
     
  2. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
  3. venkateshguru

    venkateshguru Active Member

    Messages:
    30
    Likes Received:
    1
    Trophy Points:
    110
    Hi Manoj,

    You can disable/enable the trigger when creating or using alter you can disable the trigger after creation. Please find the below code.

    CREATE OR REPLACE TRIGGER t1
    BEFORE UPDATE
    ON emp
    FOR EACH ROW
    DISABLE
    BEGIN
    NULL; --Statement
    END;


    Alter trigger t1 enable;

    Thanks ,
    Venkatesh G
     
  4. venkateshguru

    venkateshguru Active Member

    Messages:
    30
    Likes Received:
    1
    Trophy Points:
    110
    Hi Manoj,

    Suppose both trigger will created before then statement level first next row level trigger. Consider the scenario you have 2 row level trigger or statement level then last created will executed first.

    Thanks,
    Venkatesh G