Added column in SQLite database creation statement, error after running: No such column
In the context of grammatical norms, that is,
SQLite database creation, comma and space must be strictly string create_note = "CREATE TABLE" + notepadentity.table_note+ "(" + notepadentity.note_id + "int Eger primary Key AutoIncrement, "+ notepadentity.note_title +" varchar NOT NULL, "//This column added after modifying statement + Notepadentity.note_conten T + "text NOT NULL," + notepadentity.note_create_date + "text"; "; Sqlitedatabase Db;db.execsql (create_note);
is still not compiled because the SQLite creation command was executed once and the database file already exists, even if the statement has changed and no longer executes.
Workaround:
Open the Ddms tool to find "file Explorer" and navigate to the list of database files in the project file (expand to/data/data/<package name>/databases)
(You can export the database file to the computer, with the SQLite database browser and other tools to see if there are column data not created)
Delete the database file and its journal file, return to the project to run again, the program detects that the database is empty, execute the Create command, compile the pass.
At this point, export the database file under Ddms, view the list structure, add a new column to create the success, solve the problem.
O SQLite database error: No such column