commshare / sqlite4java

Automatically exported from code.google.com/p/sqlite4java
0 stars 0 forks source link

Cannot able to retrieve all rows when stored in RAM #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When i execute the program written in scala to retrieve all rows but it display 
the latest one inserted.

Can anybody help me how to rectify this.Or i want to do any changes?

while(1)
    {
        // fetch a row's status
        retval = sqlite3_step(stmt);

        if(retval == SQLITE_ROW)
        {
            // SQLITE_ROW means fetched a row

            // sqlite3_column_text returns a const void* , typecast it to const char*
            for(col=0 ; col<cols;col++)
            {
                const char *val = (const char*)sqlite3_column_text(stmt,col);
                printf("%s = %s\t",sqlite3_column_name(stmt,col),val);
            }
            printf("\n");
        }
        else if(retval == SQLITE_DONE)
        {
            // All rows finished
            printf("All rows fetched\n");
            break;
        }
        else
        {
            // Some error encountered
            printf("Some error encountered\n");
            return -1;
        }
    }

Original issue reported on code.google.com by durgadev...@gmail.com on 22 Sep 2010 at 1:28

GoogleCodeExporter commented 9 years ago
Sorry, I can't understand your question, why did you file it as a Defect, and 
how it is relevant to sqlite4java at all.

Original comment by ser...@gmail.com on 22 Sep 2010 at 1:52