Reputation: 745
I am using SQLite on Android and am getting a problem when running this command :
UPDATE vocab_words SET correct = 5
WHERE
name = 'AQA GCSE Spanish Higher',
foreign_word = 'campo, el',
english_meaning = 'field, the'
What is the problem here? Thanks in advance.
Upvotes: 1
Views: 84
Reputation: 1764
From initial viewing your post the update statement should be -
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher' and foreign_word = 'campo, el' and english_meaning = 'field, the'
Upvotes: 0
Reputation: 18123
Your SQL query has a syntax error.Change your query from:
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher', foreign_word = 'campo, el', english_meaning = 'field, the'
to:
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher'AND foreign_word = 'campo, el'AND english_meaning = 'field, the'
Also I suggest you to read basics of SQL using some tutorials. This is one of the basic error.
Upvotes: 5
Reputation: 41200
Combine two or more simple conditions by using the AND
not with comma(,)
.
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher', foreign_word = 'campo, el', english_meaning = 'field, the'
Replace with
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher' AND foreign_word = 'campo, el' AND english_meaning = 'field, the'
Upvotes: 3