![]() Use AFTER FOR EACH row triggers when you want to VALIDATE the final values So, use BEFORE FOR EACH row when you need to WRITE to the :new record ![]() ![]() So, if you doing data validation (eg: this column must be between 1 and 30 when this condition is true), you should do that in an AFTER trigger because the BEFORE triggers may change the value on you (and since BEFORE triggers fire in SOME RANDOM order - you cannot be assured that your BEFORE trigger fires before or after some other BEFORE trigger) ONLY the after for each row can look at a "stable" value in the :new record. ![]() You can have many before triggers - each modifying the :new values. A before trigger can modify the :new values.
0 Comments
Leave a Reply. |