Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Triggers

Database triggers implement logic to control transactions, such as INSERT, UPDATE, and DELETE statements. Triggers are event-driven programs fired by DML statements and include ON INSERT, ON UPDATE, and ON DELETE triggers, as well as combination event triggers in both Oracle and MySQL databases. Some triggers fire once for a statement and others fire for each row inserted, updated, or deleted by a DML statement.

Triggers that fire once per statement are called statement-level triggers. Triggers that fire once per row are called row-level triggers. Row-level triggers can override values inserted or updated. Row-level triggers can also take copies of individual column values for INSERT, UPDATE, and DELETE statements and store them in another logging table. You would log values when security rules require that you monitor the tasks performed by authorized users. For example, you might want to record information about new loans greater than $50,000 when security rules allow a loan officer to make a car loan up to $100,000, but they should generally make loans of less than $50,000. It’s a proactive way to give responsible employees some autonomy while maintaining audit controls to review some actions.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint