Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserted, Deleted Tables (Magic Tables) in MySQL

I am regular user of MS-SQL but now working on a project which has mysql as a back-end.

Please tell me that is there exists such a inserted/Deleted tables (Magic tables) in mysql which I can use inside trigger or in normal queries.

like image 658
Dr. Rajesh Rolen Avatar asked Jun 08 '11 17:06

Dr. Rajesh Rolen


1 Answers

They are called NEW and OLD in MySQL.

NEW is the new record to be inserted or the updated data.

OLD is the deleted record, or the old data before an update.

See the documentation for creating a trigger here: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html

like image 98
Fosco Avatar answered Sep 28 '22 01:09

Fosco