WITH Before Insert, TRIGGER.NEWMAP is not available as we do
not have the id of the record generated before the record is inserted, id gets
generated when the record is inserted in the database.
WITH Before Insert, TRIGGER.OLD and TRIGGER.OLDMAP will not
be available as we do not have any old data available. This will be a new record that will get inserted in the
database.
WITH After Insert, TRIGGER.OLD and TRIGGER.OLDMAP will not
be available as we do not have any old data available. This is a new record
that is inserted into the database.
WITH Before Update and After Update TRIGGER.NEW,
TRIGGER.NEWMAP, TRIGGER.OLD and
TRIGGER.OLDMAP will be available as we will have new and old data.
WITH Before Delete and After Delete we will not have TRIGGER.NEW,
TRIGGER.NEWMAP as we are not updating any data, we are just deleting the
record.
WITH After Undelete we will have TRIGGER.NEW,
TRIGGER.NEWMAP. Undelete event just restored the deleted record. Also, the id of
the record remains the same after it is restored.
Hi Very Good Explanation Thanks for sharing Knowledge with us ......
ReplyDeletethank you a lot, explanation is very well. Understood very quickly.
ReplyDeletevery helpful. Thanks
ReplyDeleteThis is the best blog I have ever seen to understood the trigger context variables. Very easy to learn and understand.
ReplyDelete