I have a trigger for saving the changes into a history table.
For DELETE and UPDATE i use the context variable "old", and for INSERT i have to use the "new" context variable.
I want to use only ONE trigger for INSERT, UPDATE and DELETE because its easier to mantain it later, and my problem ist that i look for a way to use only one variable for acessing the values from "old" and "new" context variable. Also, if INSERT then i have to use the values from "new" else from "old". But i dondt want to use the both on the same procedure.
Hou can i create a variable and assing the "new" if INSERTING and otherwise the "old" context variable?
Start Free Trial