Gerry Snyder wrote, On 2/6/2012 9:48 AM:
On 2/6/2012 8:36 AM, Bill McCormick wrote:
Is there no way to force columns added to a table with alter table to
be added at certain column positions?
Alternatively, if there is some way to save the data in an existing
table; drop the table; re-create the table with the desired schema;
and then reload the data, this would be useful as well. However, I
cannot see how to do this simply.
A very quick search at the SQLite website (hint, hint) found:
http://www.sqlite.org/faq.html#q11
Sorry, I should have mentioned that I did see that, but it doesn't quite
fit my application. I need a script that doesn't care what the existing
table looks like. In my situation, I may have dozens of databases among
different locations, perhaps not all at the same revision level. The
script I need would be able to bring each up to the current revision.
So, if I had a fist step:
CREATE TEMPORARY TABLE t1_backup AS SELECT * FROM t1;
and then
DROP TABLE t1;
and then add the table with it's latest schema revision
CREATE TABLE t1( ... );
It seems difficult to get the saved data back in ...
INSERT INTO t1 SELECT * FROM t1_backup;
... without know what the previous schema looks like. It complains like this:
Error: table prod has 27 columns but 25 values were supplied
Any ideas?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users