Welcome to the SQLitening support forums!
#INCLUDE "sqlitening.inc"
FUNCTION PBMAIN AS LONG
LOCAL sArray() AS STRING
slOpen "old.db","C" 'old schema: firstname,lastname,id
slExe "create table if not exists T1(firstname text,lastname text, id integer primary key)"
slExebind "insert into T1 values(?,?,null)",bindstr("Heidi") + bindstr("Klum")
slExebind "insert into T1 values(?,?,null)",bindstr("Robert")+ bindstr("Hope")
slExebind "insert into T1 values(?,?,null)",bindstr("Bugs") + bindstr("Bunny")
slClose
slOpen "new.db","C"
slAttach "old.db","old" 'new schema: id,name
slExe "create table if not exists T1(id integer primary key,name text)"
slExe "insert or replace into T1(id,name) select id,lastname||', '|| firstname from old.T1"
slselary "select firstname,lastname from old.t1 " +_
"union all " +_
"select id,name from t1",sArray(),"Q9c"
MSGBOX JOIN$(sArray(),$CRLF)
END FUNCTION
create table if not exists CounterTable(c1 integer,c2 text, c3 text);
insert into CounterTable (c1,c2,c3)
select 1,'cool','beans'
where not exists (select * from CounterTable);
QuoteThis is usually due to the operating system keeping recently used disk blocks in memory and/or SQLite doing the same with recently used pages from the database file.