Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    6

    Question Unanswered: Triggers and COMMIT/ROLLBACK

    I need a trigger to be fired or a stored procedure to be called on an event of COMMIT or ROLLBACK.

    Non of ORACLE, SQL-SERVER, DB2 have this feature.

    Please let me know any alternative's

  2. #2
    Join Date
    Jan 2004
    Posts
    49
    Code:
    declare @op bit
    declare @tbl table(....)
    
    begin tran
    ........................
    ........................
    ........................
    if @err > 0
      begin 
            ....... 
            insert @tbl(...) values(...)
            set @op = 0
            rollback tran
      else begin
            .......
            set @op = 1
            insert @tbl(...) values(...)
            commit tran
      end
    ..... @tbl(...)  -- maybe cursor def.
    exec proc_on_endtran @op,....
    ........

  3. #3
    Join Date
    Apr 2004
    Posts
    6

    Post

    Thank you very much for your reply. I understand what you are trying to tell.

    But actually what we are looking for is,

    Assume you have 3 client applications each starting one transaction.
    We need some procedure or trigger to be called at DB2 server end, when those transactions are commited/rollback'ed.

    Regards
    Gopal S.

Posting Permissions

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