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

Reply via email to