trigger doesn't fire with Merge Statement [message #60812] |
Mon, 08 March 2004 13:41 |
Wayne
Messages: 2 Registered: March 2004
|
Junior Member |
|
|
We have a before update trigger (enabled) on a table. When fired, the trigger will update certain date fields in the core table, and write the :old record to a history table. The trigger has an exception section to trap errors.
I'm running code that makes use of the MERGE statement. The merge statement is working, and records are being updated in the database. However, it appears as though the trigger is not firing 'for every row' as the date fields are not updated and a row is not placed into the history table. If I update the row manually via sql, the trigger behaves as expected. Do triggers not fire when using the Merge statement? Is there an addtional clause I need to use? I'm on version 9.2.0.4.0
Any help sincerely appreciated.
Thanks.......Wayne
|
|
|
Re: trigger doesn't fire with Merge Statement [message #60826 is a reply to message #60812] |
Tue, 09 March 2004 04:14 |
Frank Naude
Messages: 4580 Registered: April 1998
|
Senior Member |
|
|
Hi,
Found the following in the SQL Reference Guide:
"MERGE... If the update clause is executed, then all update triggers defined on the target table are activated."
If your trigger behave differently, you might want to raise a TAR with Oracle Support.
Best regards.
Frank
|
|
|
|
Re: trigger doesn't fire with Merge Statement [message #61925 is a reply to message #61912] |
Thu, 10 June 2004 06:31 |
Wayne
Messages: 2 Registered: March 2004
|
Junior Member |
|
|
I did not resolve the problem.
Tried several things, and verified that the trigger
worked fine without the merge statement.
We needed to complete a project asap so I just rewrote
the code and got rid of the merge statement.
Thanks for the info about it working correctly in the
9.2.0.5.0 environment.
good luck Eric
|
|
|
|