See:
http://www.sqlite.org/datatype3.html

"Each column in an SQLite 3 database is assigned one of the following
type affinities:

    * TEXT
    * NUMERIC
    * INTEGER
    * REAL
    * NONE

A column with TEXT affinity stores all data using storage classes
NULL, TEXT or BLOB. If numerical data is inserted into a column with
TEXT affinity it is converted to text form before being stored.

A column with NUMERIC affinity may contain values using all five
storage classes. When text data is inserted into a NUMERIC column, an
attempt is made to convert it to an integer or real number before it
is stored. If the conversion is successful (meaning that the
conversion occurs without loss of information), then the value is
stored using the INTEGER or REAL storage class. If the conversion
cannot be performed without loss of information then the value is
stored using the TEXT storage class. No attempt is made to convert
NULL or blob values."

--
RichardC

On Oct 24, 1:12 am, Craig <[email protected]> wrote:
> I'm missing something here - here is a brief snippet showing what I'm
> trying to do, with "db" a SQLiteDatabase object:
>
>   ContentValues values = new ContentValues();
>   values.put(KEY_DATE, "julianday('now')");
>   return db.insert(TABLE_NAME, null, values);
>
> The KEY_DATE column is an integer column, but when I browse the data,
> it looks like the String "julianday('now')" is in the database.
>
> How is that possible - I would hope trying to set a string value into
> an integer column would cause an error.
>
> Is there a way to do this with passing the SQL function through
> insert? I know I could compute the value in Java and pass that, or
> issue a raw query and deal with the cursor; I'm trying to understand
> how this works.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to