At 10:31 20.12.2009, Clyde England wrote: >I am using DiSQLite3 and have run into a rather bizarre problem when using >"Alter Table" > >I am not sure if this is a possible "Sqlite" core bug, or if it is DiSqlite3 >specific, or I am just plain doing something stupid. > >However I have been able to duplicate with a simple example using just >SQLiteSpy > >Also note that the bug only seems to happen when the following conditions >apply: > >1. The original table was created by using the syntax "Create table as select >* ......" . If you create the columns explicitly, it doesn't seem to be a >problem. >2. The new table is create in the "temp" database. That is, we use "Create >Temp table". Creating the table in the main database does not seem to exhibit >the problem. > >Try running the following code in SQLiteSpy > >create table Bug1 (code,userdata); >create temp table Bug2 as select code,userdata from bug1 >Alter Table Bug2 add column xxx; > >Now look at the field names in the new table bug2 > >?ui=2&view=att&th=125ab2abf6b2f1c8&attid=0.1&di > > >Some how it has renamed the last field to just "use" and then appended the >"rdata" to the end of our new field name Unable to reproduce. The following SQL works fine for me in SQLiteSpy: drop table if exists bug1; drop table if exists temp.bug2; create table Bug1 (code,userdata); create temp table Bug2 as select code,userdata from bug1; Alter Table Bug2 add column xxx; PRAGMA temp.table_info(bug2); Are you using the latest version? If yes, can you please send a Delphi project (source code only) that reliably exhibits the problem? Ralf