So I\'ve been so far relying heavily on the automated (well almost) onCreate
/ onUpgrade
method of my SQLite
database. It was all work
In my case there was a syntax error: one of the fields was a SQL reserved word. But to see that error message about the syntax I had to add
dbHelper.getWritableDatabase().close();
to MainActivity.onCreate()
.
Workaround I used: have a method at the "start" of my application that does just getWritableDatabase()
and closes it, so that it triggers all the needed create / update if necessary.
Some time column name is repeating during create statement..
create table tbl (Col1 TEXT,Col2 INTEGER,Col3 INTEGER,Col1 INTEGER,Col5 INTEGER);
Like here Col1 is repeat twice...