Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rename fields name
Message
From
06/09/2006 10:21:53
 
 
To
06/09/2006 10:13:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01151225
Message ID:
01151325
Views:
49
ok,
it works
thank you both

>Yes, exactly.
>
>>hi,
>>how are you and thank you for reply,
>>you mean if my old table have fields as a,b,c,d
>>
>>i can create new table have fields as t,a,b,v,c,y,d
>>
>>and via append ...
>>use newtable
>>append from oldtable&& ican get all data as it is mean
>>t=0 or null
>>a=a
>>.
>>.
>>.
>>
>>thanks.
>>>No, the new field will be added last. If you really need the fields in a special order, which I think is a bad idea, you must go via a temp file. Create a new table with the correct structure and the fields in the correct order, and append from the temp table.
>>>
>>>>hi ,
>>>>thank you for reply and help,
>>>>
>>>>is there away to add newfield to my table and put it as first field at my table vai alter
>>>>ALTER TABLE alldat ADD COLUMN num n(9) && as first field
>>>>
>>>>thanks.
>>>>
>>>>>>hi,
>>>>>>thank you for reply,
>>>>>>i think alter table good idea for me,
>>>>>>
>>>>>>to add new field i can do ..
>>>>>>ALTER TABLE Customer ADD COLUMN Fax c(20) NULL&&add from fvp help
>>>>>>ALTER TABLE Customer DROP COLUMN Fax2 &&drop from fvp help
>>>>>>
>>>>>>but
>>>>>>1.how i can change field name as under, from Area to state
>>>>>>ALTER TABLE alldat ALTER COLUMN area n(5)
>>>>>>2.how i can change field name and data type of filed
>>>>>
>>>>>I don't have VFP 9 installed right now.
>>>>>
>>>>>According to the help of version 6, it seems that you can not change the column name with ALTER TABLE. Perhaps there is a way in VFP 9 - I don't know.
>>>>>
>>>>>However, you can copy the information to a new column (field). Do the following (assuming you want to change from character to currency):
>>>>>
>>>>>
>>>>>alter table MyTable add column NewColumn Y
>>>>>update MyTable set NewColumn = val(OldColumn)
>>>>>alter table MyTable drop column OldColumn
>>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform