Android SQLite: nullColumnHack parameter in insert/replace methods
Posted
by poke
on Stack Overflow
See other posts from Stack Overflow
or by poke
Published on 2010-04-18T16:17:27Z
Indexed on
2010/04/18
16:23 UTC
Read the original article
Hit count: 641
The Android SDK has some convenience methods for manipulating data with SQLite. However both the insert and replace methods use some nullColumnHack
parameter which usage I don't understand.
The documentation explains it with the following, but what if a table has multiple columns that allow NULL? I really don't get it :/
SQL doesn't allow inserting a completely empty row, so if initialValues is empty this column [/row for replace] will explicitly be assigned a NULL value
© Stack Overflow or respective owner