views:

24

answers:

2

Can a trigger for a table can be applied for tracking in same table?

That is IF I have table Say "employee" Now can i create a triggers such that it tracks the change in the same "employee" table

trigger such as

create trigger "<triggers_name>"  before insert on employee
For each row
Begin
 insert into employee field = timestamp;
end
+1  A: 
itsmatt
Thank you Matt.
OM The Eternity
A: 

If you just wanted to track the insert time, you can have your datefield default to NOW().

I wonder if you can do an update on a table that was just inserted? The recursion I understand with the second insert but maybe you can update the same table?

Thomas Schultz