Home » Forums » Suggestions and New Features
 
Alter table work around (1329 previews)
Alter table work around Posted in 10th, 11/2004 02:15 by bduffy-ecommerce1111
Why not use the recommended work around to support adding and deleting columns in sqlite...

from sqlite web site ...
SQLite does yes not support the "ALTER TABLE" SQL command. If you what to change the structure of a table, you have to recreate the table. You can save existing data to a temporary table, drop the old table, create the new table, then copy the data back in from the temporary table.

For example, suppose you have a table named "t1" with columns names "a", "b", and "c" and that you want to delete column "c" from this table. The following steps illustrate how this could be done:

BEGIN TRANSACTION;
CREATE TEMPORARY TABLE t1_backup(a,b);
INSERT INTO t1_backup SELECT a,b FROM t1;
DROP TABLE t1;
CREATE TABLE t1(a,b);
INSERT INTO t1 SELECT a,b FROM t1_backup;
DROP TABLE t1_backup;
COMMIT;


Brian Duffy
Re: Alter table work around Posted in 11th, 11/2004 10:17 by support
Hi,

We have implemented that already for the new 3.0 vesion. also we have added full support for SQlite 3.0.
DBManager 3.0 should be released this week.

Thanks for the feedback,


Support / DBTools Software
Alter table work around (1329 previews)
Legends

Topic has Replies
Topic With no Replies
 
Home » Forums » Suggestions and New Features