Répète une instruction pour chaque référence père-à-enfant contenue dans la table courante et qui remplit une condition.
.FOREACH_CHILD ("condition")
"instruction"
.ENDFOR
Argument |
Description |
---|---|
condition |
Condition relative à la référence (voir ci-dessous) |
instruction |
Instruction à répéter |
Condition |
Sélectionne |
---|---|
UPDATE RESTRICT |
Restrict pour une modification |
UPDATE CASCADE |
Cascade pour une modification |
UPDATE SETNULL |
Set null pour une modification |
UPDATE SETDEFAULT |
Set default pour une modification |
DELETE RESTRICT |
Restrict pour une suppression |
DELETE CASCADE |
Cascade pour une suppression |
DELETE SETNULL |
Set null pour une suppression |
DELETE SETDEFAULT |
Set default pour une suppression |
Dans un trigger pour la table TITRE, la macro suivante :
.FOREACH_CHILD("DELETE RESTRICT") -- Cannot delete parent "%PARENT%" if children still exist in "%CHILD%" .ENDFOR
Génère le script de trigger qui suit :
-- Cannot delete parent "TITLE" if children still exist in "ROYSCHED" -- Cannot delete parent "TITLE" if children still exist in "SALE" -- Cannot delete parent "TITLE" if children still exist in "TITLEAUTHOR"