To create a new 'Trigger', click 'Add New Trigger "on page Propriétées the database.
You arrive on the form for all the possibilities of creation.
After entering the trigger name, select a
firing time (optional):
Choose what type
of event you want TRIGGER:
If you choose
'UPDATE OF', a text box appears to enter the list of
columns
Choose on which source it should trigger 's
run:
Define a type of
action (optional):
You can define a
condition (optional):
If you selected
'WHEN', a text box appears for entering the
conditions or
You can now enter queries that are run when triggered, enter it in the 'Step' being careful to complete each request by a ';'
You can use the values of the Trigger with the prefixes 'OLD' or 'NEW', these prefixes can be allowed in the clause 'WHEN' and the 'Step' and depending on the event:
- INSERT: NEW
- UPDATE: NEW and OLD
- DELETE: OLD
The notation is
NEW.nom_colonne or
OLD.nom_colonne