android sqlite increment a column value
android, sqlite
Solution
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;
Problem
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); } ```