Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rename fields name
Message
De
06/09/2006 08:58:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
06/09/2006 07:37:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01151225
Message ID:
01151275
Vues:
99
>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
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform