Maybe you declared the column as numeric (integer, number)?  In that case, 
later versions of SQLite might be doing the conversion for you (I can't 
remember for sure, but I seem to recall this is the case).  You might need to 
declare the column as text.
 
 At least what you posted is missing the closing paren for $dbh->do();  But 
that would throw a perl syntax error, so assuming your syntax is correct, you 
might try it like this:

$dbh->do("insert into mytable(varint) values (?)", undef, '01234');

With the vagaries of quoting, I try to use placeholders wherever possible.

 -Clark


----- Original Message ----
From: Cyril Scetbon <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Thursday, March 16, 2006 11:15:30 PM
Subject: Re: [sqlite] DBD::SQLite

just a $dbh->do("insert into mytable(varint) values ('01234')";

It's not working correctly with SQLite but no problem with Oracle.

Chris Werner a écrit :
> Can you give a code example? I have just tried, and can load string values
> with a leading 0 and m/^\d+$/
>
> I suspect the problem is in your treatment of perl...
>
> Christian Werner
>
> -----Original Message-----
> From: Cyril Scetbon [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 16, 2006 2:56 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] DBD::SQLite
>
>
> Hi,
>
> I use DBD::SQLite for accessing a SQLite database, but there's an issue 
> when I tyr to insert a number starting with a 0. In fact, DBD::SQLite 
> seems to trim the starting 0 of the number. So, when I insert 0234 in a 
> table I  find 234 instead.
>
> Anyone has encoutered and resolved this bug ?
>
>   



Reply via email to