Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,659 members, 7,955,393 topics. Date: Sunday, 22 September 2024 at 02:42 AM |
Nairaland Forum / Science/Technology / Programming / Help With Android Sqlite (756 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);" db.execSQL("INSERT INTO EPuserStatus Values('good');" 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: OMG Thanks! God bless you. I've corrected it and it's working. |
(1) (Reply)
Help On This Simple Script / Shorltlets Apartment Available At Ilupeju For Trainees / Supercharge Your Business With Power Of Internet. Get Fully Functional Ecommerce
(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. 8 |