Huge (20 digits) Primary Keys and SQLite

If I try to insert data with a 20-bit primary key into the SQLite database, I get an error with the second insert because it is "not unique." If I select the values ​​that I can see from the SQLite command line, that primary key is written in scientific notation. Column type is decimal. Is there a way to force SQLite to insert values ​​“like them” while maintaining accuracy / “normal representation” even with long values?

+5
source share
3 answers

enter it as a string, not a number.

+4
source

, - 9223372036854775807. () .

+3

Strange, it sounds like your wrapper, inserting a number into a float. I thought DECIMAL maps to an integer inside. Using a string will work, but can be slow for indexing a string, not for int.

0
source

All Articles