Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a field to a table programatically
Message
 
To
06/04/1999 15:20:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00205739
Message ID:
00205742
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform