If you want to modify the column data on the fly, prior to being posted to the database, then you want to use a BEFORE trigger FOR EACH ROW. BEFORE triggers are fired before constraints. For example, they can be used to populate a PK column before the constraint has a chance to determine if the value is null or not.
If you try to use an AFTER trigger, then Oracle will tells you two things:
1. If you try to change the value of :new.column, Oracle will tell you "ORA-04084: cannot change NEW values for this trigger type."
2. If you try to change the value of ld.column, Oracle will tell you "ORA-04085: cannot change the value of an OLD reference variable."
I don't see the point in trying to do dynamic key setting on anything other than a row level trigger.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.