1
是否有可能重新使用sqlite3的输出我有这样的查询:sqlite3_step:如何多次解析输出?
error = sqlite3_prepare_v2(conn,SQL_STMT_GET_FILE,-1, &res, &tail);
error = sqlite3_bind_text(res, 1,file,strlen(file), SQLITE_STATIC); assert(error == SQLITE_OK);
if (error != SQLITE_OK) {
handle_error("No matching record found.");
和结果分析
while (sqlite3_step(res) == SQLITE_ROW)
//do something here with results for device X
现在我想重新使用输出“水库”例如,代码流将会像
while (sqlite3_step(res) == SQLITE_ROW)
//do something here with results for device X
//reset the cursor to starting position and scan through the records.
while (sqlite3_step(res) == SQLITE_ROW)
//do something here with results for device Y
如何实现此目的?我不喜欢第二次重新运行同一个sql语句并获取结果。