Insert SQLiteDatabase Method

The second parameter of the SQLiteDatabase insertion method is "nullColumnHack". What does it mean. What value should be passed to this parameter.

thank

+3
source share
3 answers

Brief explanation ..

nullColumnHack

not necessary; may be zero. SQL does not allow you to insert a completely empty row without naming at least one column name. If your provided values ​​are empty, column names are not known and an empty row cannot be inserted. If the value is not set to null, the nullColumnHack parameter specifies the name of the null column name to explicitly insert NULL in case your values ​​are empty.

-1
source

, foo, NULL .

SQL SQL:

`INSERT INTO `foo;

SQLite. :

INSERT INTO foo (somecol) VALUES (NULL);

, , ContentValues insert(), Android SQLite - , NULL. , : , Magic 8-Ball (TM), , ..

ContentValues insert(), ...: -)

commonsware.

+4

nullColumnHack . null, nullColumnHack , NULL , .

0

All Articles