Re: [sqlite] Does sqlite3_exec work with sqlite3_bind ?

2012-06-22 Thread Simon Slavin

On 22 Jun 2012, at 11:28am, "deltagam...@gmx.net"  wrote:

> Thx for the quick response.
> 
> So sqlite3_exec can only be used with "static" sql_statements.

Yes.  _exec() gets fed one or more commands in a long string.  Binding works 
only when you use _prepare(), _step(), _finalize().

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Does sqlite3_exec work with sqlite3_bind ?

2012-06-22 Thread deltagam...@gmx.net

Am 22.06.2012 12:01, schrieb Richard Hipp:

On Fri, Jun 22, 2012 at 1:03 AM, deltagam...@gmx.net wrote:


sqlite3_prepare_v2() 
>,
sqlite3_step() 
>,
and sqlite3_finalize() 


,

 From the documentation  I saw, that sqlite3_exec "includes"
sqlite3_prepare_v2 , sqlite3_step, sqlite3_finalize.
But if the select_statement contains some variables to bind, is it
possible to use then the wrapper sqlite3_exec ?

If the select_statement would be
select_statement = "SELECT id, eventdate, eventtype, counter FROM eventlog
WHERE eventdate BETWEEN ? AND ?";

how would I use the wrapper sqlite3_exec ?


It is not possible to use sqlite3_bind_() with sqlite3_exec().  Any
variables in the sqlite3_exec() SQL will have the value of NULL.




__**_
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users



Thx for the quick response.

So sqlite3_exec can only be used with "static" sql_statements.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Does sqlite3_exec work with sqlite3_bind ?

2012-06-22 Thread Richard Hipp
On Fri, Jun 22, 2012 at 1:03 AM, deltagam...@gmx.net wrote:

> sqlite3_prepare_v2() 
> >,
> sqlite3_step() 
> >,
> and sqlite3_finalize() 
> 
> >,
>
> From the documentation  I saw, that sqlite3_exec "includes"
> sqlite3_prepare_v2 , sqlite3_step, sqlite3_finalize.
> But if the select_statement contains some variables to bind, is it
> possible to use then the wrapper sqlite3_exec ?
>
> If the select_statement would be
> select_statement = "SELECT id, eventdate, eventtype, counter FROM eventlog
> WHERE eventdate BETWEEN ? AND ?";
>
> how would I use the wrapper sqlite3_exec ?
>

It is not possible to use sqlite3_bind_() with sqlite3_exec().  Any
variables in the sqlite3_exec() SQL will have the value of NULL.


>
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Does sqlite3_exec work with sqlite3_bind ?

2012-06-21 Thread deltagam...@gmx.net
sqlite3_prepare_v2() , 
sqlite3_step() , and 
sqlite3_finalize() ,


From the documentation  I saw, that sqlite3_exec "includes" 
sqlite3_prepare_v2 , sqlite3_step, sqlite3_finalize.
But if the select_statement contains some variables to bind, is it 
possible to use then the wrapper sqlite3_exec ?


If the select_statement would be
select_statement = "SELECT id, eventdate, eventtype, counter FROM 
eventlog WHERE eventdate BETWEEN ? AND ?";


how would I use the wrapper sqlite3_exec ?


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users