Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add column within loop
Message
 
 
To
04/05/2009 07:25:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01397733
Message ID:
01397738
Views:
51
>Hi,
>I'd like to add columns to table with the help of FOR loop but I'm stuck with the column name.
>How can the table's name be updated within the loop not to be dulicated.
>Thanks
>Tamas
try
for i = 100 to fcount()+100
   alter table myTable add column ('fld' + transform(i))
next
catch to loError
   ** Display error info
endtry
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform