On 2016/05/16 2:58 PM, E.D. wrote:
> Hi.
>
> The sqlite3 documentation specifies, that sqlite3_prepare*() compile "the 
> first statement" from the sqlite3_stmt ** argument. This argument ought to be 
> explained thoroughly.
> What exactly can be put through this argument? Compound statements, 
> transactions? What syntax?

I don't think there is such a thing as a compound statement, it's just a 
statement. A transaction is not a statement either. "BEGIN;" is a statement.

If I had to try my hand at a definition, I'd say a statement is any 
single SQL Query that is in itself a complete instruction, starts with 
an SQL keyword and optionally ends with a ";" (assuming you haven't 
changed the statement termination character). MSSQL allows you terminate 
with a <CRLF> and a "GO", etc.

What that piece of documentation simply means is that any statement 
after the first will be ignored, so basically everything after the first 
terminating ";", if any.

Further, any statement in SQLite that does not follow another statement 
that started a transaction, is in itself implicitly a transaction.

To get multiple statements to be executed, you can try the 
sqlite3_execute() method - it allows multiple statement lists (aka 
scripts or "compound" statement s if you like) and transactions.


Reply via email to