How do I store long values in Android SQLite database ? I am trying to store the time(milliseconds) values which comes in long type format .
Asked
Active
Viewed 2.1k times
3 Answers
55
An INTEGER column will handle long values.
From the SQLite site:
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

keyser
- 18,829
- 16
- 59
- 101
1
If you don't care about sign, store it as INT8. It's 8 bytes (64 bits) unsigned. Or, convert to/from string.

Simon
- 14,407
- 8
- 46
- 61
-
INT8 will be converted to INTEGER in sqlite. (Or, at least that's how I understood the affinity section) – keyser Sep 25 '12 at 14:05