-
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
-
You can start an package functon
in an autonomous transaction
you find examples of autonomious
transactions on technet sample code
-
Thanks a lot schlaeger, using 'pragma autonomous_transaction' worked.
-
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