next up previous
Next: Up: Integrity Constraints Previous: Assertions

Triggers

  1. Another feature not present in the SQL standard is the trigger.

    Several existing systems have their own non-standard trigger features.

  2. A trigger is a statement that is automatically executed by the system as a side effect of a modification to the database.

  3. We need to
  4. For example, suppose that an overdraft is intended to result in the account balance being set to zero, and a loan being created for the overdraft amount.

    The trigger actions for tuple with a negative balance are then

    Note that this is not a good example. What would happen if the customer already had a loan?

  5. To write this trigger in terms of the original System R trigger:





Page created and maintained by Osmar R. Zaï ane
Last Update: Mon Oct 16 17:01:17 PDT 1995