Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,181,195 members, 7,913,397 topics. Date: Wednesday, 07 August 2024 at 05:48 AM

Help With Android Sqlite - Programming - Nairaland

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

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)

(1) (Reply)

Help With Android Sqlite by Jinf: 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).

1 Like 1 Share

Re: Help With Android Sqlite by Jinf: 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)

Android App Idea / How Do I Upload Picture Field From Vb6 To Access 2013 Database / Arduino Microcontroller Board Thread

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 5
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.