Hi all, i have two tables
1) Employee
2)Employee_Updates
Whenever i add a new record or update existing record in Employee table, that recod should go and insert into the Employee_updates table.
I want to do this by write a trigger that call a procedure.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Why in the world do you want to call another procedure? just to add overhead and make the code more difficult to be maintained?
If any of my guys comes to my desk with such an idea I would hit him/her in the head with a frying pan and send him/her back to his/her desk to think about it. Unfortunately out of courtesy towards you - not to say physical location - I cannot do the same in this particular case.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
You cannot do that. I understand your frustration when i say procedure to do the Updates or Inserts. You meant to say trigger it self good to do that?
Exactly. You already have your trigger -which is nothing but a procedure then, do whatever you have to do in the trigger.
Your insert/updates are going to affect a different table therefore you are not in risk of mutating table syndrome; just do it in your trigger, much clean, less overhead... or face the frying pan
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks