Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>I had code in the Delete trigger for a table. It was a simple IIF() that returned true or false. I then set up my cascading deletes and it added "__ri_delete_main().and." to the code I had there before. Now I can't delete anything. Either side works alone but together I receive a "delete trigger error".
>Help.
>Also, is there a way to set and regenerate the RI code from within a program? Some customers have .dbc files without the cascading deletes set and we would like to send out a utility that would set up the cascading deletes and regenerate the code.
>Thanks.
Hmm... that's weird... but, your your iif() is going to cause a roolback then the trigger should probably be...
iif(yourexpressionhere,.t.,.f.) and _ri_delete_main()
This would be evaluated from left to right... But, it also sounds like what you are doing would be better as a table RULE... A rule is fired before the save, and if it fails, there is no save... a Trigger is fired after the save... so, generally, you want triggers to be things that won't stop your save, but will just react to it.
BOb
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement