Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a field to a table programatically
Message
 
À
06/04/1999 15:20:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00205739
Message ID:
00205742
Vues:
16
You can use ALTER TABLE to add a field. You can also use FSIZE() to determine whether a field already exists. Let's say you want to add a field called lMailAdd to the table address if it's not already there. You could do this:
IF !USED('address')
  USE address IN 0
ENDIF

IF FSIZE('lMailAdd','address')=0
  ALTER TABLE address ;
    ADD COLUMN lMailAdd L NULL
ENDIF
>Is there a good method for adding a field to a table programatically. In the event that you have databases deployed at the client's site and you need to add additional fields (the tables already having data in them) what is the best approach? I was hoping to write an update routine that would make the necessary changes to the tables.
>
>Thanks in advance...
>
>John Dennis
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform