このエラーを理解できません。更新コマンドで更新するフィールドが 10 ありますが、このエラーが発生します09-17 17:18:25.234: E/AndroidRuntime(4929): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jpos/com.sys.Main}: java.lang.IllegalArgumentException: the bind value at index 11 is null
インデックス 11 が null であることを示していますが、テーブルのフィールドの合計列は 10 です。
09-17 17:18:25.203: W/dalvikvm(4929): threadid=1: thread exiting with uncaught exception (group=0x40015560)
09-17 17:18:25.234: E/AndroidRuntime(4929): FATAL EXCEPTION: main
09-17 17:18:25.234: E/AndroidRuntime(4929): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jpos/com.sys.Main}: java.lang.IllegalArgumentException: the bind value at index 11 is null
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.os.Handler.dispatchMessage(Handler.java:99)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.os.Looper.loop(Looper.java:123)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.ActivityThread.main(ActivityThread.java:3647)
09-17 17:18:25.234: E/AndroidRuntime(4929): at java.lang.reflect.Method.invokeNative(Native Method)
09-17 17:18:25.234: E/AndroidRuntime(4929): at java.lang.reflect.Method.invoke(Method.java:507)
09-17 17:18:25.234: E/AndroidRuntime(4929): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-17 17:18:25.234: E/AndroidRuntime(4929): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-17 17:18:25.234: E/AndroidRuntime(4929): at dalvik.system.NativeStart.main(Native Method)
09-17 17:18:25.234: E/AndroidRuntime(4929): Caused by: java.lang.IllegalArgumentException: the bind value at index 11 is null
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:237)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1701)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:1636)
09-17 17:18:25.234: E/AndroidRuntime(4929): at com.jpos.classes.jposDbHelperHashMap.updateTableMunicipality(DbHelperHashMap.java:103)
09-17 17:18:25.234: E/AndroidRuntime(4929): at com.jpos.JPOSMain.UpdateTableMunicipalityCodes(JPOSMain.java:146)
09-17 17:18:25.234: E/AndroidRuntime(4929): at com.jpos.JPOSMain.onCreate(JPOSMain.java:115)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-17 17:18:25.234: E/AndroidRuntime(4929): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
09-17 17:18:25.234: E/AndroidRuntime(4929): ... 11 more
ここに私の更新コマンドがあります
private void UpdateTableMunicipalityCodes() {
HashMap<String, String> queryValues = new HashMap<String, String>();
queryValues.put("munc_id", "7");
queryValues.put("rdo_code", "999" );
queryValues.put("munc_code", "999");
queryValues.put("munc_desc", "UPDATECOMMAND");
queryValues.put("area_code", "999");
queryValues.put("created_date", "2013-17-2013 06:02:29");
queryValues.put("created_by", "SYSGENn");
queryValues.put("last_modified_date", "2013-17-2013 07:02:09");
queryValues.put("last_modified_by", "SYSGENn");
queryValues.put("munc_status", "A");
hashDbHelper.updateTableMunicipality(queryValues);
}
ここを通過する:
public void updateTableMunicipality(HashMap<String, String> queryValues)
{
database = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put("MUNC_ID", queryValues.get("munc_id"));
values.put("RDO_CODE", queryValues.get("rdo_code"));
values.put("MUNC_CODE", queryValues.get("munc_code"));
values.put("MUNC_DESC", queryValues.get("munc_desc"));
values.put("AREA_CODE", queryValues.get("area_code"));
values.put("CREATED_DATE", queryValues.get("created_date"));
values.put("CREATED_BY", queryValues.get("created_by"));
values.put("LAST_MODIFIED_DATE", queryValues.get("last_modified_date"));
values.put("LAST_MODIFIED_BY", queryValues.get("last_modified_by"));
values.put("MUNC_STATUS", queryValues.get("munc_status"));
database.update("tbl_municipality_codes", values, "MUNC_ID" + " = ?", newString[] { queryValues.get("MUNC_ID") });
System.out.println("Updated " + queryValues.get("munc_id"));
}
これが私のテーブル作成クエリです
query ="CREATE TABLE [tbl_municipality_codes] (" +
"[MUNC_ID] [INT(1000)] NOT NULL," +
"[RDO_CODE] [VARCHAR(50)] NOT NULL," +
"[MUNC_CODE] [VARCHAR(50)] NOT NULL, " +
"[MUNC_DESC] [VARCHAR(100)] NOT NULL, "+
"[AREA_CODE] VARCHAR, "+
"[CREATED_DATE] DATETIME NOT NULL," +
"[CREATED_BY] [VARCHAR(50)] NOT NULL, "+
"[LAST_MODIFIED_DATE] DATETIME," +
"[LAST_MODIFIED_BY] [VARCHAR(50)],"+
"[MUNC_STATUS] [VARCHAR(1)] NOT NULL,"+
"CONSTRAINT [sqlite_autoindex_tbl_municipality_codes_1] PRIMARY KEY ([MUNC_ID]))";
私のエラーは、テーブルの制約自動インデクサーにあると思います.どうすれば修正できますか?