Hello everyone,

please CC me in replies to this mail. I'm no subscriber of this mailing list.

I would like to use the optional LIMIT and ORDER BY clause for DELETE 
statements in SQLite. I can verify that SQLite was built with 
SQLITE_ENABLE_UPDATE_DELETE_LIMIT:

> sqlite> PRAGMA compile_options;
> 
> ENABLE_COLUMN_METADATA
> ENABLE_FTS3
> ENABLE_FTS3_PARENTHESIS
> ENABLE_FTS4
> ENABLE_RTREE
> ENABLE_UNLOCK_NOTIFY
> ENABLE_UPDATE_DELETE_LIMIT
> SECURE_DELETE
> SYSTEM_MALLOC
> TEMP_STORE=1
> THREADSAFE=1

Anyway, when I run the following query on my table logs (CREATE TABLE logs(id 
INTEGER PRIMARY KEY AUTOINCREMENT, time INTEGER DEFAULT CURRENT_TIMESTAMP, type 
INTEGER NOT NULL ON CONFLICT ABORT, entry TEXT NOT NULL ON CONFLICT ABORT)), 
this happens:

> sqlite> DELETE FROM logs WHERE type = 0 ORDER BY time LIMIT -1 OFFSET 100;
> Error: near "ORDER": syntax error

The database was created without ENABLE_UPDATE_DELETE_LIMIT compiled in (I 
rebuilt sqlite for ENABLE_UPDATE_DELETE_LIMIT). Might this cause the trouble?


Thanks in advance,
Jeremy

Reply via email to