sql Exec
sql exec runs one statement: CREATE, INSERT, UPDATE, DELETE, BEGIN, COMMIT, PRAGMA, …
Rows it returns are discarded, and the rows of the last sql query are kept, so
you can run sql exec inside a loop over a query’s rows.
The statement is everything after sql exec, exactly as written. %x, !x, #x and *x where a value
goes are passed to SQLite as values, never pasted into the text.
Example
Section titled “Example”sql open mychar.dbsql exec CREATE TABLE IF NOT EXISTS kills(mob TEXT, at INTEGER)set %mob orcsql exec INSERT INTO kills(mob, at) VALUES(%mob, #SysTime)display ok Row #SqlLastID addedhaltEach sql exec that changes data is its own transaction, which is slow for many rows. Wrap a batch in
sql exec BEGIN … sql exec COMMIT.
See Using SQL for how statements are written and how variables go in and out.