O SQLite database error: No such column

Source: Internet
Author: User
Tags sqlite sqlite database

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.