Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:17:32+00:00 2026-06-14T21:17:32+00:00

Is it possible to re-use the sqlite3 output?I have query like this : error

  • 0

Is it possible to re-use the sqlite3 output?I have query like this :

            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.");

and results are parsed

    while (sqlite3_step(res) == SQLITE_ROW) 
                //do something here with results for device X

Now I would like to re-use the output ‘res’ for example, the code flow will be like

    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

How to achieve this ? I prefer not to re-run the same sql statement for the second time and fetch the results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:17:35+00:00Added an answer on June 14, 2026 at 9:17 pm

    You must either cache the data yourself, or re-run the query.

    Read about the reasons on this page about Sqlite and Scrolling Cursors, including:

    The problem is that the sqlite3_step() function does not step through a precomputed result set at all. A better and more realistic way to think about matters is to suppose that each prepared statement is really a computer program. You are running this program in a debugger and there is a breakpoint set on a single statement somewhere deep down inside the computation. Calling the sqlite3_step() function is like pressing the “Run” button in your debugger and thus asking the debugger to run the program until it either exits or hits the breakpoint. Sqlite3_step() returns SQLITE_ROW if it hits the breakpoint and SQLITE_DONE if it finishes. If you hit the breakpoint, you can then look at local variable in order to find the values of a “row”. Then you can press the “Run” button (call sqlite3_step()) again to continue execution until the next breakpoint or until the program exits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible use a MySQL query to perform this kind of check? If
Is this possible to use Ajax.Beginform with update target inside of ajax form. like
I would like to know whether it is possible to use a SELECT statement
How is it possible? I have a simple C++ app that is using SQLite3
From the documentation it looks like this is not possible, but I want to
is it possible to use DB like Sqlite or sqlCe for wp7 rather than
is it possible to use the logparser commandline utility to output sql statements as
Is it possible to use SQLite on Android and a NoSQL database like MongoDB
is it possible to use SQLite for a j2me application ? has anyone ever
Possible Duplicate: Reading and writing images to an SQLite DB for iPhone use How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.