Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically removing persistant relationships
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00189004
Message ID:
00189388
Vues:
19
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform