views:

40

answers:

1

Hello,

is it possible to use prepared statements with the SELECT command?

I wrote in C++ following code:

sqlite3_bind_int(this->ppGetStmt, 1, id);

int rc = sqlite3_step(this->ppGetStmt);
//sqlite3_result_int(this->ppGetStmt, &value);

sqlite3_reset(this->ppGetStmt);

The SQL statement looks like following SELECT value FROM test WHERE id=?;.
But how can I get the value out of the statement?

I consult sqlite.org, but can't find any helpful informations.

EDIT:
Solution can found here: http://www.sqlite.org/cintro.html chapter 1.1.

+1  A: 

After each call to sqlite3_step() for which you receive a SQLITE_ROW return value, you use the column access functions to get your values out.

gregg