Doesn't it return an array of sqlite3_stmt pointers?

If you prepare this statement:

"BEGIN; UPDATE something SET this='that'; COMMIT;"

Then the array will contain the statement handles for the three
statements BEGIN, UPDATe and COMMIT.

/Jonas

On Tue, Mar 9, 2010 at 7:17 PM, Igor Tandetnik <itandet...@mvps.org> wrote:
> Ed Curren <ecur...@hotmail.com> wrote:
>> According to the documentation the function prototype for
>> sqlite3_prepare_v2 is the following:
>>
>>
>>
>> int sqlite3_prepare(sqlite3 *db, const char *zSql, int nByte,
>> sqlite3_stmt **ppStmt, const char **pzTail);
>
> Note two stars in sqlite3_stmt **ppStmt. You pass a pointer to sqlite3_stmt* 
> (whose previous value is irrelevant and will be overwritten), and the 
> function fills it with the handle. Like this:
>
> sqlite3_stmt* stmt = NULL;
> sqlite3_prepare(db, "select * from mytable;", -1, &stmt, NULL);
> // Now stmt contains statement handle.
>
> In other words, it's an out parameter.
>
> Igor Tandetnik
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to