7.1. Sequence of Events

You can do the following with an INSERT STATEMENT trigger:

  • You can perform an aggregate computation on the table. This can be computed before or after the insert.

  • You can use a statement level trigger to process data that is collected by a row trigger. This is covered in Section 7.4, “Processing Row Captured Data.”

  • You can signal an event. This can simply be a print statement. It can also be an email or signal to another process using the DBMS_ALERT package.

Figure 7-1 illustrates the behavior of statement level triggers that can perform “Take Action” functions of “Reject the Transaction” functions. The statement level trigger has no knowledge of the before and after values of any changed row. For a comparison with row triggers, compare Figure 7-1 with Figure 6-1.

Figure 7-1. Statement Level Trigger.


Figure 7-1 illustrates the statement level behavior. It also shows that row level triggers fire between the before-statement and after-statement triggers. If three rows are affected by a SQL UPDATE, as is the example in this figure, three row triggers will fire. Statement level triggers fire once.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.18.112.250