audit-trigger
audit-trigger copied to clipboard
Query to display the data
The script was run and is operating normally.
I want to make a query to return the structure:
field | previous value | current value
When the action is equal to "Insert", to show the fields content only in the "current value" column.
Example:
field | previous value | current value
id | (Null) | 1 name | (Null) | Rick
When the action is equal to "Update."
Example:
field | previous value | current value
id | 1 | 1 name | (Null) | Richard
And finally "Delete":
field | previous value | current value
1 | 1 | (Null)