0

收到错误04-12 08:38:33.943: E/Database(441): Failure 1 (near "Table": syntax error) on 0x341088 when preparing 'CREATE TABLE Table (_id INTEGER PRIMARY KEY,location_name TEXT NOT NULL,longi TEXT NOT NULL,lati TEXT NOT NULL);'. 我在 Eclipse 中遵循了Android 'create table if not exist' 错误, 但我的表代码仍然相同
,如下所示

public void onCreate(SQLiteDatabase db) {
                // TODO Auto-generated method stub
                db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
                        KEY_ROWID + " INTEGER PRIMARY KEY," +
                        KEY_LOCATION + " TEXT NOT NULL," +
                        KEY_LONGI + " TEXT NOT NULL," + KEY_LATI + " TEXT NOT NULL);"
                );
4

1 回答 1

1

TABLE是 SQLite 中的保留字,因此您不能在Table不转义或重命名表的情况下命名表。

于 2012-04-10T19:23:05.767 回答