Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How may I change order of a field in a table ?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00439283
Message ID:
00439377
Vues:
19
>>>I alredy know the command ALTER TABLE .... to modify a table. I'm able to add fields, but they are always added as the last field. I would like to know how to insert a field at the position I want or to only change the position of an existing field. Of course, I want to do this by programmation...
>
>>About 3 months ago I had the similar problem and thread. I think, there is no way to change order of the fields rather than manually re-arrange them.
This is just an idea, but should work:
>- Use AFIELDS()
>- AINS() rows corrsponding to new fields.
>- create a new table
>- APPEND FROM exisitng table (fields with matching names should be mapped correctly)
>- delete the current table
>- and finally rename the new table.

Hi Houston,

Actually, I thought about it too, but:
1) What if the table is part of DBC?
2) What if it contains too many records?
3) How about indexes?

Quite a combersome solution... Pity, that there is no simple mechanism for doing that.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform