views:

256

answers:

1

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?

+1  A: 

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.

John JJ Curtis
many thanks for this
Remover
You're welcome, I hope your app does well!
John JJ Curtis