inspectionid
对于我的更新,我想使用,搜索正确的 pos activityid
,subactivityid
但是当调用更新语句时,我得到了这个错误。有人可以帮忙。
public int updateSubActivityActivityComment(String comment, int rating, int subActivityId, int activityId, int inspectionId){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(KEY_RATING, rating);
contentValues.put(KEY_COMMENT, comment);
return db.updateWithOnConflict(TABLE_INSPECTION, contentValues,KEY_SUB_ACTIVITY_ID+ " = ? "+subActivityId+" AND "+KEY_INSPECTION_ID + " = ? "+inspectionId +" AND "+KEY_ACTIVITY_ID +" = ? "+activityId,new String[]{String.valueOf(subActivityId)} ,SQLiteDatabase.CONFLICT_IGNORE);
}
日志猫-
java.lang.IllegalArgumentException: Too many bind arguments. 3 arguments were provided but the statement needs 2 arguments.
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:68)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1574)
at com.theavo.ck_app.DatabaseHelper.updateSubActivityActivityComment(DatabaseHelper.java:264)
at com.theavo.ck_app.FragmentSubInspectionComment.onClick(FragmentSubInspectionComment.java:470)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)