Oracle trigger if updating then

The actions you're performing on the data is technically different between the insert/update portions, but what about the business logic difference?

IMO, your best bet is to contain a functional unit of work inside of a trigger, so that there is no discrepancy in what that trigger does.

In all cases, the SQL statements running within triggers follow the common rules used for standalone SQL statements.

if you want to change the INSERT trigger you can't accidentally break the UPDATE one if they're separate), but otherwise - much of a muchness.When we retrieve that column, the query does not return the updated column values, but other columns are being updated and we are able to see those values. It happens more often than you might think, in real life.) I looked at their trigger and decided immediately that I did not like it.First, their NAME attribute should have been a column in a view (or, in Oracle Database 11, a virtual column). A trigger defined on a schema fires for each event associated with the owner of the schema (the current user).A trigger defined on a database fires for each event associated with all users. Compound triggers make it easier to program an approach where you want the actions you implement for the various timing points to share common data. When a trigger is fired, the tables referenced in the trigger action might be currently undergoing changes by SQL statements in other users' transactions.

Leave a Reply