Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Orphan protection
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00054872
Message ID:
00054876
Views:
33
>>I commonly display, edit, and add child records in a grid of a form that also displays a record of the parent. When adding, I get the parent key, then INSERT INTO childtable(parentkey) VALUES parent.keyvalue. That works fine. But I was thinking, for absolute prevention of orphans, maybe I should give the parentkey field of the child table the default value parent.key. Or maybe that's a bad idea. The parent table would have to be open, and not at EOF(). If the child was actually a child of two tables (relating them many to many) then both tables would have to be open. Maybe a stored procedure could take care of this stuff. Is this all a good idea generally, and, if so, what do I need to watch out for?
>
>Basically, it's routine job for RI INSERT trigger.

That trigger makes sure the child's parent key exists in the parent table. I was thinking of something that would make the child parent key default to the keyvalue of the current record in the parent table. That's probably not necessary, though. It may not even be desirable, sometimes. I'll leave it alone.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform