Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Positioning fields when modifying table structure
Message
From
16/05/1998 16:49:46
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00099041
Message ID:
00099951
Views:
19
>>I'm told that I must move all new fields before fields adddate and addtime which are the last fields in my main table.
>>
>Position dependent fields in a relational database is a problem itself. In a relational database the only things the developer is supposed to depend on are the table name and the field name.
>
>You may be able to do what you want but it wil not be easy. You will need to copy all of the data oput of the existing table to a temproary table. Then recreate the existing table completley so the fields are positioned where you want them. Since you will need to destroy the existing table before you can recreate it you will then need to recreate any indexes that existed and any relations that existed relaed tot that table. Once all of that has been done you will then need to append all of the data from the temporary table you created in the first place to save the data.

An easier way out of this could be:
- copy all the data somewhere (or at least the adddate and addtime fields)
- drop the adddate and addtime fields
- add the new fields
- add the adddate and addtime fields as new fields
- set relation to recno() into the copy of the table and replace 1:1 the adddate and addtime fields from it
- discard the copy if everything went fine

Backup first, off cross :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform