Example #1
0
/**
 * Prepare and runTimer a single statement of SQL.
 */
void prepareAndRun(sqlite3 *db, string stmt, timer &t) {
	sqlite3_stmt *pStmt;

	t.start();
	checkErr(sqlite3_prepare_v2(db, stmt.c_str(), -1, &pStmt, NULL), __LINE__, db, stmt);
	while (checkErr(sqlite3_step(pStmt), __LINE__, db, stmt) == SQLITE_ROW);
	checkErr(sqlite3_finalize(pStmt), __LINE__, db, stmt);
	t.end();
}