Sorry for bothering again, I am a Sqlite novice and need some help.
I am trying to update a single filed in a single row of a table .
I try to do this with:
db.getWritableDatabase().execSQL("UPDATE data SET korean = "
+kopulito+ " WHERE _id = " + constantsCursor.getString(0), null);
But I get the above mentioned error. This is my LogCat.
05-05 09:58:07.776: E/AndroidRuntime(30495): FATAL EXCEPTION: main
05-05 09:58:07.776: E/AndroidRuntime(30495): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.koday/com.example.koday.MainActivity}: java.lang.IllegalArgumentException: Empty bindArgs
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.os.Handler.dispatchMessage(Handler.java:99)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.os.Looper.loop(Looper.java:130)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.ActivityThread.main(ActivityThread.java:3683)
05-05 09:58:07.776: E/AndroidRuntime(30495): at java.lang.reflect.Method.invokeNative(Native Method)
05-05 09:58:07.776: E/AndroidRuntime(30495): at java.lang.reflect.Method.invoke(Method.java:507)
05-05 09:58:07.776: E/AndroidRuntime(30495): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-05 09:58:07.776: E/AndroidRuntime(30495): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-05 09:58:07.776: E/AndroidRuntime(30495): at dalvik.system.NativeStart.main(Native Method)
05-05 09:58:07.776: E/AndroidRuntime(30495): Caused by: java.lang.IllegalArgumentException: Empty bindArgs
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1793)
05-05 09:58:07.776: E/AndroidRuntime(30495): at com.example.koday.MainActivity.updateall(MainActivity.java:301)
05-05 09:58:07.776: E/AndroidRuntime(30495): at com.example.koday.MainActivity.onCreate(MainActivity.java:72)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-05 09:58:07.776: E/AndroidRuntime(30495): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
05-05 09:58:07.776: E/AndroidRuntime(30495): ... 11 more
Thanks a lot.
this works for me: just remove null parameter from the execSql command
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With