Can we store bigint data type in sqlite using room greater than 64 bits

Viewed 409

I need to use number value greater than 64 bits do sqlite database will store it.

1 Answers

SQLite only supports five datatypes: TEXT, INTEGER, REAL, BLOB, and NULL. However, both Integer and Real can only store 8-byte values(64-bits). If your big-int variable is greater than 8 digits/bytes you have to use a workaround. First, convert the number to a string before saving it to SQLite and then parse it to an integer/bigInt/double once you retrieve it. If the number is too big (longer than 256 bytes), you can opt to store it as a string using the BLOB data type.

Related