Hello,

If I run the attached script (results I see in attached text), one can see a 
problem with true and false in variables. If I write true or false directly, no 
problem, sqlite store a 1 or a 0.

But if a put them in a variable, sqlite always store them as strings "true" or 
"false". 

How to achieve a correct result with a $value or :value without prefiltering 
values “true” or “false”?

Thank you,

Gilles.

sqlite3 version: 3.24.0 2018-06-04 19:24:41 
c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199aalt1
libsqlite3 version: 3.25.3
INSERT INTO test (b) VALUES (true);
values(b)  = 1
values(id) = 1


INSERT INTO test (b) VALUES (:tvalue);
values(b)  = 1
values(id) = 1

values(b)  = true
values(id) = 2


INSERT INTO test (b) VALUES (false);
values(b)  = 1
values(id) = 1

values(b)  = true
values(id) = 2

values(b)  = 0
values(id) = 3


UPDATE test SET b = :fvalue WHERE id = 2
values(b)  = 1
values(id) = 1

values(b)  = false
values(id) = 2

values(b)  = 0
values(id) = 3


UPDATE test SET b = false WHERE id = 2
values(b)  = 1
values(id) = 1

values(b)  = 0
values(id) = 2

values(b)  = 0
values(id) = 3


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to