Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verify if a field already exists in a table
Message
De
06/07/2007 12:35:21
 
 
À
06/07/2007 12:27:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01238247
Message ID:
01238254
Vues:
36
This message has been marked as the solution to the initial question of the thread.
>How can I verify if a field already exists in a table?...
>Need to create it if doens´t....


If it does not exist, add it
If Fsize("MyField") = 0
   Alter Table MyTable Add Column MyField C(10)
EndIf
Another:

If it does exist, drop it
If Fsize("MyField") > 0
   Alter Table MyTable Drop Column MyField
EndIf
Exclusive of course.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform