是否可以重新使用 sqlite3 输出?我有这样的查询:
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
现在我想重新使用输出'res',例如,代码流就像
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 语句并获取结果。