I'm using SQLite 3.7.4 (within my c++ app under Ubuntu PP) and when I try to save string like "000000" it saves just one char "0". I tried it in console too - is it feature, or bug? How can I get rid of that?
For example:
CREATE TABLE status (readTime INTEGER, status STRING);
INSERT INTO status (readTime, status) values(1234, "000000");
INSERT INTO status (readTime, status) values(4321, "111111");
SELECT * FROM status;
1234|0
4321|111111
Some quick research points to the fact that STRING is not a recognized type in SQLite (or, I believe, most other SQL dialects). However, SQLite isn't strict with its types, so the type defaulted to NUMERIC. You should be able to change the column type to TEXT to resolve your issue.
Further reading: Type Affinity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With