Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table upgrade
Message
From
04/09/2005 09:48:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01046655
Message ID:
01046656
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Dear all
>
>It´s easy to upgrade an .exe but no so easy to upgrade a table.
>My costumers already have data into their .dbf (there)
>
>Now I added new fields to the new .dbf (here)
>
>My plan is to send them new a software and they will install it in
>a new folder
>
>And will use a routine such as below
>
>***************
>Use new table_which_contais_new_fields
>append from /oldfolder/old_table
>************************
>
>I have 2 questios regarding this issue
>
>1- Will it work ?

Yes, I do something similar, to upgrade, from my sample structure to the shared data on the network.

If you have referential integrity, you have to copy the parent table before the child table; otherwise - if there is a "restrict insert" option - you might get a "trigger failed" error.

The new structure must have zero records in all tables. In actual practice, I do all changes in the empty structure, and then use the method you explain to update my own copy of the data, for testing purposes. Later, I update the shared data on the network, similarly.

>2- Is it the best way to make such uptade ?

Well, if I remember correctly, some people have suggested the StoneField Toolkit for something similar; but the APPEND FROM method should also work.

Yet another alternative is to use ALTER TABLE for a few tables; but I think the APPEND FROM approach is more flexible - you keep all the structures in your database, such as views, referential integrity, triggers, etc.
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform