I have table called mdl_user and I added a new columns for this table, the first one is called "LastOperation" and the second one "TimeStamp"
I need to create trigger after insert or update or delete and write the output as "I" or "U" or "D" at "LastOperation" column and the time when this action happenes at "TimeStamp" column
NOTE: All this stuff to be in the same table not to be triggered for another table
You can get what you want and still use standard DML (including delete). It does however require a little behind the scenes manipulation of database objects. What it involves doing your DML against not a table but an update-able view.
You now process everything against the view (most existing code will not require updating). But you may need some additional functionality for actually processing the table. See example here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.