rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
The code, in this case, does not process this statement!!?? <<--
        apstr = (const char*)sqlite3_column_text(mystmt,pos);
std::cout << apstr << std::endl;  //<<-- this is not executed 
}
Table:
id | tile | fname | mname | lname |
------------------------------------------- 


void ClassforSQLite3::getList(
    const Glib::ustring& db_name, // Database name
    const Glib::ustring& token) // Key word to search in the database
throw(jme::Exception) {
    Glib::ustring apstr;
    Glib::ustring sName;
    int apint;
    mySQLite3* db; 
    try {
        db = new mySQLite3(db_name.c_str());
    } catch(somexception& e) {
        ...
    }

   // SQL statement
    apstr = "SELECT fname FROM ";
    apstr += this->db_table_name;
    apstr += " WHERE title = \'";
    apstr += token;
    apstr += "\' ";
    apint = 1;
    db->setStmt(apstr);
    sName = db->read_str(apint); // here is where the problem is see the method 
below


--------------------------------------------
const Glib::ustring& mySQLite3::read_str(const int pos)
throw(jme::Exception) {

    rc = sqlite3_prepare_v2(db, this->SQLStatement.c_str(), -1, &mystmt, NULL);
    if(rc != SQLITE_OK) { 
        // do something
    }
    rc = sqlite3_step(mystmt);
    if(rc == SQLITE_ROW ) {
        // The code, in this case, does not process this statement!!?? <<--
        apstr = (const char*)sqlite3_column_text(mystmt,pos);
    }
    try {
        this->finalize();
    } catch(somexception& e) {
        throw e;
    }
    return apstr;
}

What am I doing wrong?

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to