Good day,

I'm just exporting data to another db of known same structure, and setting
a flag. It seems that one row shows an incorrect result, but only so in my
c++ code.

I extracted the queries being run using my debugger, and tried them in the
command prompt.

When I run the following batch of queries.


Table is
CREATE TABLE WorkStations (WSIDtxt text primary key, LocationID integer,
record_updatetime text, write_out_ok int default 0);

Command Prompt results:
Tests prepared with:
update workstations set write_out_ok=0;

sqlite> select * from workstations;
WSIDtxt|LocationID|record_updatetime|write_out_ok
DT00-13-D3-50-AF-F9|2|2009.02.03.13.41|0
PROGRAMMER-LAB00-1E-90-31-8D-19|3||0
PROGRAMMER-LAB00-03-0D-00-00-01|3||0
ADAM-PC00-25-64-8C-5A-3B|3|2012.03.21.18.57.19|0


 attach
'Z:\PINTS\modules\deltafiles\deltas\2012.03.21_ADAM-PC00-25-64-8C-5A-3B_r006.db'
as 'foo' ;

 insert into foo.WorkStations select distinct * from main.WorkStations M
where M.write_out_ok =0 and M.wsidtxt is not null;

 update WorkStations  set write_out_ok =1  where wsidtxt in (select wsidtxt
from foo.WorkStations ) ;


sqlite> select * from foo.workstations;
ADAM-PC00-25-64-8C-5A-3B|3|2012.03.21.18.57.19|0
DT00-13-D3-50-AF-F9|2|2009.02.03.13.41|0
PROGRAMMER-LAB00-03-0D-00-00-01|3||0
PROGRAMMER-LAB00-1E-90-31-8D-19|3||0
sqlite> select * from workstations;
DT00-13-D3-50-AF-F9|2|2009.02.03.13.41|1
PROGRAMMER-LAB00-1E-90-31-8D-19|3||1
PROGRAMMER-LAB00-03-0D-00-00-01|3||1
ADAM-PC00-25-64-8C-5A-3B|3|2012.03.21.18.57.19|1


After executing a program that should have identical results, as identical
queries are run:
foo.workstations is identical.

sqlite> select * from workstations;
WSIDtxt|LocationID|record_updatetime|write_out_ok
DT00-13-D3-50-AF-F9|2|2009.02.03.13.41|1
PROGRAMMER-LAB00-1E-90-31-8D-19|3||1
PROGRAMMER-LAB00-03-0D-00-00-01|3||1
ADAM-PC00-25-64-8C-5A-3B|3|2012.03.21.18.57.19|0

(Windows 7 32 bit edition PC. Tried with new copy of amalgamation 3.7.11 as
well as 3.7.4)

Why is the last entry wrong?  Any suggestions as to how to review?


regards,
Adam DeVita
VerifEye Technologies Inc.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to