Are you putting single quotes around it? That's what you need.
sqlite> create table text (t1 text, t2 varchar);
sqlite> insert into text values ('01234','01234');
sqlite> select * from text;
01234|01234
sqlite> insert into text values (01234,01234);
sqlite> select * from text;
01234|01234
1234|1234
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
________________________________
From: [email protected] on behalf of Ted Rolle, Jr.
Sent: Wed 5/19/2010 2:36 PM
To: SQLite Database
Subject: [sqlite] Leading zeros disappear
I'm entering UPCs.
0071318119 becomes 71318119. This is not good, or expected, for that
matter
.
The column is specified as TEXT.
I thought that TEXT values went in 'as entered'. After reading the
docs, Section 2.0:
"If numerical data is inserted into a column with TEXT affinity it is
converted into text form before being stored."
I changed the column type to BLOB. Same result.
A UPC field surely is not any sort of numerical value.
For instance, you cannot add two UPCs and return a valid result.
I just need to be spun around and pointed in the right direction!
--
__________________________________________________________________
3.14159265358979323846264338327950 Let the spirit of pi
2884197169399375105820974944592307 spread all over the world!
8164062862089986280348253421170679 http://pi314.at <http://pi314.at/> PI
VOBISCUM!
==================================================================
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users