Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger Question
Message
From
21/12/1999 20:30:47
 
 
To
21/12/1999 19:28:30
Frank Mundo
WindowDressers, Inc.
Maine, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00307030
Message ID:
00307050
Views:
20
>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
Map
View

Click here to load this message in the networking platform