Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically removing persistant relationships
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00189004
Message ID:
00189388
Views:
20
>Hi Bret.
>
>>In order to delete some tables, I have to first remove their relations. I have been using SET RELATION OFF INTO childtable.
>
>That won't work -- SET RELATION is for temporal relations (those set using the SET RELATION command), not for persistent relations. You have to use ALTER TABLE DROP FOREIGN KEY in the child tables to remove the persistent relation, then you can DROP TABLE or REMOVE TABLE to remove the parent. If you want to keep the index in the child table but just remove the relation, add the SAVE keyword in ALTER TABLE.
>
>Doug
When I do these things, I then need to Clean Up Database and regenerate RI code. I believe that VALIDATE DATABASE is not the same as the Clean Up Database option in the Database menu. How do I do these things programmatically?

By the way, when I used the replaced the REMOVE TABLE mytable DELETE commands with DROP TABLE, they worked without an error message. I still have the SET RELATION OFF INTO commands in there.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform