Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALTER TABLE Woes
Message
From
04/03/1998 04:34:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/03/1998 17:46:59
Matthew Manicolo
Circa Telecommunications
Melbourne, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00082377
Message ID:
00082430
Views:
29
>Hi all,
> I need to use an ALTER TABLE comand and shown below where the column is a variable that changes. I need to do this so that I can create the table that I want at runtime. Is this possible because foxpro uses the actual vaiable as the column name. Can anyone help?
>
>ALTER TABLE temp_call_details ADD COLUMN variable_name C( 1)
>
>I've also tried
>
>new_variable_name = &variable_name
>ALTER TABLE temp_call_details ADD COLUMN new_variable_name c( 1)

Use name expression. That is surround the varname with parentheses.
variable_name = "Newcolumn"
ALTER TABLE temp_call_details ADD COLUMN (variable_name) C( 1)

*ALTER TABLE temp_call_details ADD COLUMN &variable_name C( 1)
* Would also work but slower, name expression is the correct way
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform