I spent 2 days trying to figure this out, and wouldn't you know it...2
minutes after posting to the group, I think I have figured out what I was
doing wrong.

In order to check my work, I was exporting the database to my local computer
and opening it with SQLite Administrator. The values were appearing as 0
because the "affinity" of this column in the database was set as INTEGER. So
it while is appeared that these values were getting stored as 0, in
actuality they were just getting displayed as 0 in SQLite Administrator.

The true value of these fields are indeed getting stored properly. I just
had to CAST(expires as NUMERIC) in order to view them.

Sorry for the false alarm.



On Tue, Apr 13, 2010 at 10:37 AM, Justin Giles <jtgi...@gmail.com> wrote:

> Here is a list of data types that are allowed in SQLite 3:
> http://www.sqlite.org/datatype3.html
>
> Note that there is no official "long" data type.  It would be classified as
> INTEGER or REAL.  For actual "long" data types that don't seem to be stored
> well in SQLite you might do better to store as TEXT and do a conversion
> outside of SQLite.
>
> I am by no means a database expert though, perhaps someone with more SQLite
> experience will chime in with a better explanation.
>
> Justin
>
> On Tue, Apr 13, 2010 at 9:18 AM, Jeff <jeff.th...@gmail.com> wrote:
>
>> Has anyone been able to get Long Integers to work with a SQLite DB on
>> Android?
>>
>> In particular, I am noticing some odd behavior with Webkit's Cache
>> Database. The "expires" column is always 0. After doing some testing,
>> I realized that SQLite will accept a value in the "expires" column up
>> to (2^31 - 1). Anything higher than this, and the value is always 0.
>>
>> The cache database uses Date.getTime() to populate this field. Since
>> this is a long, the value is always 0.
>>
>> Is this a bug in the Cache Database or the SQLite implementation?
>>
>> Jeff
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to