[sqlite] sqlite3_prepare*() statement argument detailed

2016-05-16 Thread Clemens Ladisch
E.D. wrote:
> The sqlite3 documentation specifies, that sqlite3_prepare*() compile
> "the first statement" from the sqlite3_stmt ** argument. This argument
> ought to be explained thoroughly.

It is explained thoroughly on .


Regards,
Clemens


[sqlite] sqlite3_prepare*() statement argument detailed

2016-05-16 Thread E.D.
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? 


[sqlite] sqlite3_prepare*() statement argument detailed

2016-05-16 Thread R Smith


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  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.




[sqlite] sqlite3_prepare*() statement argument detailed

2016-05-16 Thread Stephan Beal
On Mon, May 16, 2016 at 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?
>

The first _SQL statement_ is processed. Anything after that is ignored. e.g.

select 1 from foo; -- first statement ends here
select 2 from foo; -- this is ignored.


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf


[sqlite] sqlite3_prepare*() statement argument detailed

2016-05-16 Thread R.A. Nagy
SQL statements end with a ";"

That is what is meant by "statement."



On Mon, May 16, 2016 at 8:58 AM, 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?
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>