DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: performing commits within a trigger

  1. #1
    Join Date
    Jul 2002
    Posts
    5
    Hi,

    I have built a trigger which calls a procedure. This procedure in turn calls procedures within a package. The procedures within the package have commit statements within them.

    When the trigger fires the following error occurs:

    ORA-04092 cannot commit in a trigger

    Is there any way around this? Alternatively, how else can you schedule things to run in Oracle when certain conditions are met that are not time related (i.e. a data change)?

    Thanks for your help

  2. #2
    Join Date
    Apr 2001
    Posts
    1
    You can start an package functon
    in an autonomous transaction

    you find examples of autonomious
    transactions on technet sample code

  3. #3
    Join Date
    Jul 2002
    Posts
    5

    Thumbs up

    Thanks a lot schlaeger, using 'pragma autonomous_transaction' worked.

  4. #4
    Join Date
    Apr 2001
    Location
    United Kingdom
    Posts
    31
    coolbuy,
    just curious , I know you may have considered this and it might be your requirement, but are u sure you want to use autonomous transaction in your case. you have to handle undoing what the procedure did when the transaction fails.

    Cheers

Posting Permissions

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


Click Here to Expand Forum to Full Width