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
mjschwenger
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
Littlefoot
Messages: 21823
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
JRowbottom
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 Dec 08 06:49:28 CST 2024