CSchulz
CSchulz

Reputation: 11020

Prepared Statement with Select? Possible?

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.

Upvotes: 0

Views: 1252

Answers (1)

gregg
gregg

Reputation: 1027

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.

Upvotes: 1

Related Questions