₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,165 members, 8,510,483 topics. Date: Friday, 30 October 2026 at 01:16 PM

Toggle theme

Help With Android Sqlite - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Help With Android Sqlite (857 Views)

1 Reply

Help With Android Sqlite by Jinf(op): 6:57am On Apr 22, 2015
I'm getting this error: android.database.sqlite.SQLiteException: near "EXIST": syntax error: CREATE TABLE IF NOT EXIST EPuserStatus(Status VARCHAR);

See my code below...

SQLiteDatabase db = openOrCreateDatabase("ExamPoemsStatus", MODE_PRIVATE, null);

try {
db.execSQL("CREATE TABLE IF NOT EXIST EPuserStatus(Status VARCHAR);"wink;
db.execSQL("INSERT INTO EPuserStatus Values('good');"wink;

Cursor result = db.rawQuery("SELECT * FROM EPuserStatus", null);
result.moveToFirst();
String status = result.getString(1);




Toast.makeText (getBaseContext(), "Data: " +status.toString(), Toast.LENGTH_SHORT).show();

db.close();
}
catch (Exception e) {Toast.makeText (getBaseContext(), "Error: " +e.toString(), Toast.LENGTH_LONG).show();
}
Re: Help With Android Sqlite by nollyj: 8:25am On Apr 22, 2015
It should be exists instead of exist (notice the "s" at the end).
Re: Help With Android Sqlite by Jinf(op): 8:49am On Apr 22, 2015
nollyj:
It should be exists instead of exist (notice the "s" at the end).
OMG Thanks! God bless you. I've corrected it and it's working.
1 Reply

Help! Sqlite Database Not Updating After Using Bind_param • Anybody Here Know How One Can Password/encrypt Sqlite Database in C++? • Help With Sqlite Select • 2 • 3 • 4

We Are Given Out Discount On Any Web Design, Development And Mobile App Project • Do You Need A Mobile App • Do You Need A Mobile App