On Tue, 2005-06-14 at 20:18 +0000, [EMAIL PROTECTED] wrote: > I have textual data that may look like integers (eg. "0325763213"). > On insertion, any leading "0" will vanish. How do I prevent this > and make the data be inserted verbatim? > > Simple illustration: > > sqlite3 test 'create table t ( k text unique, v text);' > perl -e 'use DBI; $db = DBI->connect( "dbi:SQLite:dbname=test" ); > $db->do( qq[REPLACE INTO t VALUES(?,?);], undef, "key", > "0325763213");' > sqlite3 test 'select * from t;' > > returns: > > key|325763213 > >
It looks like perl is making this conversion for you. SQLite does not do this. As a work-around, consider prepending a single 'x' character to every "v" column entry then strip of the 'x' before you use it. -- D. Richard Hipp <[EMAIL PROTECTED]>