[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    [sqlite] Unsigned int 64 in WHERE
From:       Vivien Malerba <vmalerba () gmail ! com>
Date:       2009-02-27 15:25:25
Message-ID: bd20ce3f0902270725w6aadf8c6oe758293a1106ffd4 () mail ! gmail ! com
[Download RAW message or body]

Hi!

I have a table with a timestamp column which I use to insert sqlite_uint64
values using sqlite3_bind_int64()
(values are retreived using sqlite3_column_int64() with a cast to
sqlite_uint64). This works fine with the C API.

The problem is that when I try to use the sqlite3 command line, if I use:
SELECT data FROM mytable WHERE ts=18446744072622041475;
I get no result at all (the 18446744072622041475 value is too big to fit
into a signed 64 bit integer, but it fits in an unsigned 64 bits integer),
so I have to use
SELECT data FROM mytable WHERE ts=-1087510141;

In other terms, I have to use the signed 64 bits integer in my WHERE clause
(2^64-1087510141 = 1844674407262204147).

Is there any other way of storing an unsigned 64 bits integer in the
database than storing it as a signed value and casting its binary value to
unsigned, for example if there was a sqlite3_bind_Uint64() and a
sqlite3_column_Uint64()?

Thanks a lot,

Vivien
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic