天天看点

【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表已经存在,无法创建重名的数据表。

解决方法

  • 我的解决方法是重新命名表名称