Trigger to operate on multiple tables, via OR [message #36504] |
Fri, 30 November 2001 10:42 |
mtower_in_houston
Messages: 2 Registered: November 2001
|
Junior Member |
|
|
I want to tell my trigger to operate
If there's an update to table1
-OR -
If there's an update to table2
-OR -
If there's an update to table3
But I can't seem to find a way to do that, using
CREATE OR REPLACE TRIGGER trig_update_sales
AFTER UPDATE ON table1
OR AFTER UPDATE ON table2
FOR EACH ROW
Tweaking the syntax doesn't seem to help. Maybe you just can't do it. Does anyone know? Thanks.
----------------------------------------------------------------------
|
|
|
|
|
Re: Trigger to operate on multiple tables, via OR [message #36533 is a reply to message #36505] |
Mon, 03 December 2001 06:05 |
mtower_in_houston
Messages: 2 Registered: November 2001
|
Junior Member |
|
|
Thanks, Roy. However, the project specifically calls for writing only ONE trigger. This trigger is to operate when any of the four tables is updated. I handled it this way:
I wrote four separate procedures: one for each table. Each of the four procedures writes to an audit table. The triggers (only one trigger) operates off the audit table, rather than operating off the original four tables.
----------------------------------------------------------------------
|
|
|