the question is on the callback function's return values of sqlite3_exec()

when using sqlite3_exec() to do "select * from ...", how to get all the
return values by using the callback function?

struct olt_info
{

    int olt_index;
    int olt_logo;
    char* olt_line;
    // int nmber;
};

int my_callback(void *olt_temp, int argc, char *value[], char *name[])
{
    struct olt_info *pdata = NULL;
    pdata = (struct olt_info *)olt_temp; 

    int jj;
    for (int i = 0; i < argc; i++)
        jj = printf("%s == %s\n", name[i], value[i]);

    pdata->olt_index = (int)atoi(value[0]);
    pdata->olt_logo = (int)atoi(value[1]);
    pdata->olt_line = value[2];

    return 0;
}

it could print the result, but couldn't return the values. If do like so,
just one value could be get.
how to get all the values?

-- 
View this message in context: 
http://www.nabble.com/a-question-on-the-callback-function%27s-return-values-of-sqlite3_exec%28%29-tp22176984p22176984.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to