天天看點

【Android】 android.database.sqlite.SQLiteException: table my_table already exists(code 1 SQLITE_ERRO)

報錯

【Android】 android.database.sqlite.SQLiteException: table my_table already exists(code 1 SQLITE_ERRO)

分析

​android.database.sqlite.SQLiteException: table my_table already exists (code 1 SQLITE_ERROR): , while compiling: CREATE TABLE my_table(id INTEGER PRIMARY KEY AUTOINCREMENT,production_name TEXT,production_price REAL)​

​就是說my_table表已經存在,無法建立重名的資料表。

解決方法

  • 我的解決方法是重新命名表名稱