.schema
CREATE TABLE mytable(varint text);
Sorry, but it's working with the do function.
However it's not working when I use bind variables even if I force the
SQL_VARCHAR type :
use DBI;
$dbh= DBI->connect("dbi:SQLite:dbname=./test.db",{ RaiseError => 1,
AutoCommit => 1 });
$stmt=$dbh->prepare("insert into mytable(varint) values(?)");
$stmt->bind_param(1, '01237', { TYPE => SQL_VARCHAR });
#$stmt->execute('01238');
$stmt->execute();
Chris Werner a écrit :
Can you run .schema on the table?
-----Original Message-----
From: Cyril Scetbon [mailto:[EMAIL PROTECTED]
Sent: Friday, March 17, 2006 1:16 AM
To: sqlite-users@sqlite.org
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 ?