I am trying to increment the value in a row by 5. I have searched here and Google but so far have not found and answer that works. Below is what seems to have the least amount of errors from Eclipse.
private static String[] table_scores = {DHObject.TABLE_SCORES,};
private static String[] column_tokens = {DHObject.COLUMN_TOKENS,};
private static String[] column_points = {DHObject.COLUMN_POINTS,};
private static String[] column_num = {DHObject.COLUMN_NUM,};
public Cursor onCorrectAnswer() {
rawQuery(table_scores, [column_tokens = column_tokens + 5], column_num 0);
rawQuery(table_scores, [column_points = column_points + 5], column_num 0);
}
To increment a column's values, you have to execute an SQL statement like this:
UPDATE Scores
SET Tokens = Tokens + 5,
Points = Points + 5
WHERE Num = 0;
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