Results 1 to 7 of 7

Thread: Insert Trigger

  1. #1
    Join Date
    Nov 2003
    Location
    India
    Posts
    114

    Unanswered: Insert Trigger

    I have a Insert Trigger on some table. When I insert a row in that table the trigger will be fired after the COMMIT of insert or it will be fired as soon as I insert something into table. If later is the case does this mean that even if I rollback my insert my trigger would had been fired and done it's work ?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Trigger is a part of the transaction so it's fired before or after the insert and the changes made by the trigger will share the fate of the entire transaction: if it's commited they'll be committed too; if the transaction rolls back so do the triggered changes.

  3. #3
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    trigger runs on insert. doesn't metter if you later rollback or commit your transaction

  4. #4
    Join Date
    Nov 2003
    Location
    India
    Posts
    114

    confused

    Contradictry answers. Can some1 confirm.

  5. #5
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    Quote Originally Posted by varun_751980
    I have a Insert Trigger on some table. When I insert a row in that table the trigger will be fired after the COMMIT of insert or it will be fired as soon as I insert something into table.
    as soon as you insert something into table

    Quote Originally Posted by varun_751980
    If later is the case does this mean that even if I rollback my insert my trigger would had been fired and done it's work ?
    if you rollback your transaction, changes made by trigger will be rollbacked too

  6. #6
    Join Date
    Oct 2005
    Posts
    61
    If you want the rolled back insert to be logged as triggered event user autonomous transaction.

  7. #7
    Join Date
    Nov 2003
    Location
    India
    Posts
    114

    Thanks

    Thanks a lot madafaka

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •