Wednesday, June 11, 2008, 12:12:33 AM, you wrote:

p> Hello. I really need help with this, because Im almost out of
p> ideas here. Help please!

p> sqldata is a vector< vector < char* > >
p> row is a vector < char* >

p> sqldata sql3wrapper::pobierzPodmiot(){
p>     const char* tail;
p>     sqlite3_stmt* statement;
    
p>     std::string query = squery("SELECT * FROM %;",PODMIOTY_TABLE);
    
p>    
p> sqlite3_prepare_v2(interface,query.c_str(),-1,&statement,&tail);
p>     sqldata data;
p>     for(int a=0;sqlite3_step(statement)!=101;a++){
p>         row set;
p>         data.push_back(set);
p>         for(int az=1; az<sqlite3_column_count(statement); az++){
p>            
p> data[a].push_back((char*)sqlite3_column_text(statement,az));
p>     }
p>         std::cout<<(data[a])[2]<<std::endl;
p>     }
p>     return data;
p>     sqlite3_finalize(statement);
p> }

p> this does cout properly. But when I'm using it in a different place:

Try moving:
     sqlite3_finalize(statement);
     return data;

I would also populate set and then push that to data. And I would use
one of the C++ wrappers seeing that you are using C++.
     
-- 
Best regards,
  Neville Franks, http://www.surfulater.com http://blog.surfulater.com
 

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

Reply via email to