Home » RDBMS Server » Server Administration » How to jump over a trigger
How to jump over a trigger [message #194702] Sun, 24 September 2006 09:31 Go to next message
Messages: 137
Registered: July 2005
Location: US
Senior Member
I have a trigger that is on a base production table - very simple logic: Create trigger on Base table for insert -> insert into audit table * from inserted. OK, but the audit table belongs to other department I cannot make any changes. It is truncated in the night, but in the day some other applications are writing, locking tha tbale, etc. fun stuff, and I end up into situation that my trigger fails (I lose transactions that I need) because the insert into the audit table fails. Is there a way to catch an error and if this insert fails and just to commit my own transaction. I know that the trigger is a transaction by itself. I tried several ways but all I tried fails... Any work around?
Any idea is apprecited.
Thanks lot, mj
Re: How to jump over a trigger [message #194711 is a reply to message #194702] Sun, 24 September 2006 14:37 Go to previous messageGo to next message
Messages: 21066
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
To commit only your transaction, use AUTONOMOUS TRANSACTION.
Re: How to jump over a trigger [message #194978 is a reply to message #194711] Tue, 26 September 2006 06:46 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Sounds like you need an Exception block in the trigger to catch any errors, and prevent them from propogating and causing the transaction to fail.
Previous Topic: Problems in compiling invalid objects
Next Topic: db_files and maxdatafiles
Goto Forum:

Current Time: Sun Apr 30 08:14:35 CDT 2017

Total time taken to generate the page: 0.10805 seconds