>>>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