SQLite Forum

sqlite3 rounding off the values of timestamp causing issues
Login
Thanks for the reply Gunter!
I think sqlite shouldn't have an issue with VARCHAR but I tried adding the datatype as TEXT to see if that made any difference. I dont see any change in the way sqlite treats TEXT or VARCHAR.
The issue is with the way sqlite2 dumps the values. I see values that are alphabetical having quotes around them but the numeric strings (such as the timestamps) are printed without quotes. This confuses the sqlite3 when it reads the queries.

# # sqlite new.db .dump
BEGIN TRANSACTION;
CREATE TABLE "value_tbl" ("value_id"    INTEGER NOT NULL,"value_value" TEXT NOT NULL,"value_order"      INTEGER DEFAULT 0);
INSERT INTO value_tbl VALUES(1,1536738388.3623876328,0);
COMMIT;

# # sqlite new.db .dump | sqlite3 letsee.db
# # sqlite3 letsee.db .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "value_tbl" ("value_id"      INTEGER NOT NULL,"value_value" TEXT NOT NULL,"value_order"      INTEGER DEFAULT 0);
INSERT INTO value_tbl VALUES(1,'/lib/svc/manifest/application/security/tcsd.xml',0);
INSERT INTO value_tbl VALUES(2,'1536738388.36239',0);
INSERT INTO value_tbl VALUES(2,'1536738388.36239',0);
COMMIT;