SQLite Store strings that start with zero e.g. "001" SQLite Store strings that start with zero e.g. "001" sqlite sqlite

SQLite Store strings that start with zero e.g. "001"


Works ok for me:

sqlite> create table sotest   ...> (   ...> col1 varchar(20)   ...> );sqlite>sqlite> select * from sotest;sqlite>sqlite> insert into sotest values ('001');sqlite> select * from sotest;001sqlite>

Maybe you weren't quoting your strings? For example:

sqlite> insert into sotest values ('001');sqlite> select * from sotest;001sqlite> insert into sotest values (001);sqlite> select * from sotest;0011sqlite>


Column type should set to varchar, not string, if type is string zero will be dropped automatically.