SQLite Forum

Feature request: SQLITE_PREPARE_MULTISTMT
Login
It would only return `SQLITE_DONE` after all of the statements are done; after each statement is done it just continues with the next one (returning `SQLITE_ROW` once a new result row is available, executing multiple statements at once if there are no result rows). If there is an error, you don't know which statement failed (unless the caller provided SQL statements that return data to delimit the statements, so that the caller can tell).

Also, multiple SELECTs joined together with UNION ALL can only use a single ORDER BY clause, and won't work if you want to include statements other than SELECT as well.

(This new mode might sometimes be useful with prepared user-entered SQL codes with host parameters (especially when you want to call stepping them rather than using a callback function), to avoid having to manage the statements separately.)