Q
Problem solve Get help with specific problems with your technologies, process and projects.

Trigger that will not fire when certain column is updated

I'm trying to write an Oracle update trigger that will NOT fire when a certain column is updated. Let's say I have four columns, a, b, c and d. I only want the trigger to work when a, b and d are updated. It would be best if I could say something like "update on table when column not like c." The c column is consistent throughout all of my 196 tables; the columns a,b and d are not. I'm using Oracle 8.1.7.

In Oracle, a trigger can be fired on UPDATE of specific columns. The following syntax can be used to define a trigger that will fire on updates of only specific columns of a table:

CREATE OR REPLACE TRIGGER my_tab_upd_trigger
BEFORE UPDATE OF column_a,column_b,column_d
ON my_tab
FOR EACH ROW
BEGIN
....
END;
/
Hopefully, you can see how I only have three of the four columns defined in the trigger definition. If column_c is updated, the trigger will not fire.

For More Information


Dig Deeper on Oracle database design and architecture

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close