getting error 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);'.
i followed Android 'create table if not exist' error in Eclipse but still same error
my table code as follows
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);"
);
TABLEis a reserved word in SQLite, so you can’t name your tableTablewithout escaping it or renaming it.