F Frank Cazabon Member Licensed User Longtime User Aug 1, 2014 #1 Hi, Do I have to do anything special to create a table in an SQLite database with a field that accepts null values? Here's my code to create the table and I want to allow a null value to be put in srt_date: B4X: Dim m As Map m.Initialize m.Put("srt_name", DBUtils.DB_TEXT) m.Put("srt_date", DBUtils.DB_TEXT) DBUtils.CreateTable(SQLite, "SelectedRoute", m, "")
Hi, Do I have to do anything special to create a table in an SQLite database with a field that accepts null values? Here's my code to create the table and I want to allow a null value to be put in srt_date: B4X: Dim m As Map m.Initialize m.Put("srt_name", DBUtils.DB_TEXT) m.Put("srt_date", DBUtils.DB_TEXT) DBUtils.CreateTable(SQLite, "SelectedRoute", m, "")
LucaMs Expert Licensed User Longtime User Aug 1, 2014 #2 You do not need anything else. Hopefully, that function (CreateTable) should be modified in such a way that it allows you to add NOT NULL, CHECK, UNIQUE, PRIMARY KEY and FOREIGN KEY constraints Upvote 0
You do not need anything else. Hopefully, that function (CreateTable) should be modified in such a way that it allows you to add NOT NULL, CHECK, UNIQUE, PRIMARY KEY and FOREIGN KEY constraints
Beja Expert Licensed User Longtime User Aug 1, 2014 #3 You can convert the null value to empty string "" Check this thread: http://www.b4x.com/android/forum/threads/display-of-sqlite-null-values.34087/#post-199594 Upvote 0
You can convert the null value to empty string "" Check this thread: http://www.b4x.com/android/forum/threads/display-of-sqlite-null-values.34087/#post-199594