In Previous article, we learnt about what is trigger.
In this article, we will learn about Magic tables in triggers.
Magic Tables are logical tables which are created automatically when DML operations (insert/update/delete") are performed. These tables temporarily holds the data depending upon the operation and are accessible in triggers.
There are two types of magic tables
In this article, we will learn about Magic tables in triggers.
Magic Tables are logical tables which are created automatically when DML operations (insert/update/delete") are performed. These tables temporarily holds the data depending upon the operation and are accessible in triggers.
There are two types of magic tables
- Inserted
- Deleted
- Insert: Inserted table is created when an insert operation is performed and holds recently inserted data in the table.
- Update: Both Inserted and Deleted tables are created when an update operation is performed. Inserted table holds the updated rows (new data) while deleted table holds the old data of the rows which are updated as a result of update statement.
- Delete: Deleted table is created when delete operation is performed and holds recently deleted data from the table.
<< Prev | Home | Next >> |
No comments:
Write Comments