Reputation: 1638
Does anyone know if the LIMIT and OFFSET clause work when using the UPDATE statement on iphone. on the sqlite3 website it says
"if SQLite is built with the SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time option then the syntax of the UPDATE statement is extended with optional ORDER BY and LIMIT clauses.."
if not, can it be enabled?
I'm using "UPDATE TESTDATA SET VAR = 1 LIMIT 1 OFFSET 1"
but i get an error: near "LIMIT": syntax error
I can get LIMIT and OFFSET clause to work on a SELECT statement.
Are there any other ways around this?
Upvotes: 0
Views: 1101
Reputation: 21160
Seems like those only make sense in a SELECT statement. If you want to restrict the rows updated in an UPDATE statement, you should add a WHERE clause.
Upvotes: 1