Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Columns
Message
 
 
To
28/10/2002 15:02:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00716154
Message ID:
00716162
Views:
19
You can use TYPE() function to check if field exists and ALTER TABLE command to add it if it doesn't. Something like
IF TYPE("mytable.myfield") = "U"
  ALTER TABLE mytable ADD COLUMN myfield C(10)
ENDIF
>Hello all,
>
>I need code that will do the following:
>
>1. Check to see if a column (field) exists in a table.
> 1a. If the column does exist, then exit.
> 1b. If the column does NOT exist, then add the column to the table.
>
>
>Any help will be appreciated.
>Thanks,
>Billy
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform