General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only