[DBD-SQLite] Re: DBD::SQLite / 32-bit Perl and 64-bit INTEGER PRIMARY KEY

kenichi ishigaki kishigaki at gmail.com
Thu Oct 6 05:19:46 GMT 2011

Hi Matthias,

2011/10/6 Adam Kennedy <adamkennedybackup at gmail.com>:
> Hi Matthias
> I may not be the best person to address this question to, as I'm just
> the release manager and crotchety old fogie of DBD::SQLite.
> The question is best addressed to the DBD::SQLite mailing list.
> dbd-sqlite at lists.scsys.co.uk (forwarded)
> Adam K
> On 5 October 2011 03:33, Matthias Waldorf <matthias.waldorf at zoom.de> wrote:
>> Dear Adam,
>> sorry if this a stupid question, but I could not find out how to use a
>> 64-bit INTEGER PRIMARY KEY with a 32-bit version of Perl.
>> My primary key is a 64-bit number stored as a 16-byte hexadecimal string. Is
>> there a way to specify an hexadecimal number as INTEGER PRIMARY KEY for an
>> INSERT, UPDATE or SELECT statement?

INTEGER PRIMARY KEY is something special for sqlite, and you can't insert
anything sqlite doesn't consider an integer. Maybe you might want to
drop "INTEGER"
(or "PRIMARY KEY" if applicable) from your schema, and always treat your keys as
hexadecimal strings (or decimal strings if you convert them to 64bit
integer with the help
of Math::BigInt). You might also want to provide some custom collation
function if you
need finer control (please refer to the DBD::SQLite pod).

Hope this helps,


>> Thank you very much for your help!
>> Matthias
> _______________________________________________
> DBD-SQLite mailing list
> DBD-SQLite at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbd-sqlite

More information about the DBD-SQLite mailing list