₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,001 members, 8,419,873 topics. Date: Thursday, 04 June 2026 at 05:42 AM

Toggle theme

Help With Android Sqlite - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp With Android Sqlite (835 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_paramAnybody Here Know How One Can Password/encrypt Sqlite Database in C++?Help With Sqlite Select234

20 Great Google SecretsI Want Someone To Create An App For My Wordpress BlogBe a Provider Of Mobile Messaging Business In Nigeria (image)