On 2/28/06, Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:
> The sqlite documentation states that when the stored value of an Integer
> field is NULL and is used sqlite3_column_int to retrieve the data, the
> returned value is 0.
> Currently to know if the value is zero or NULL i check the value of
> sqlite3_column_text (that returns NULL in that case). The drawback of
> this solution is that i retrieve two times the same record. Is there a
> more straight forward way of doing this?
NULL = "Nobody entered anything in this column"
0 = somebody entered zero in this column.
Which may be very different things.
If you need to differentiate then you can use this:
select my_column from my_table where my_column is not null
If you want to default to zero, then set the default on the column to be zero.
Hope that helps.