Search code examples
oracle-databaseplsqltriggersoracle9i

How to fire a trigger after finishing data insert in a table


I have a table A into which I am inserting data. Then some calculation is being done updating the same table A.

I want to fire a trigger, which calls a Procedure A after the completion of data insertion ( after insert and update ).

How do I do this?

Is there any other way to do it automatically... Or do I have to run Procedure A manualy after the completion of data insertion in table A.


More simply, I would like to know how to fire a trigger after inserting a few rows and a commit, i.e. not for each row.


Solution

  • You can define your trigger to be fired for each row or for each statement (FOR EACH ROW option).

    If I understood you right, you would like to fire the trigger after a bunch of statements? Don't think you can. Even if you can, I would rather not do it. They scatter your program flow / logic and make it harder to understand later how your software works.

    Regards