thanks Pavel, I tried but the problem persist. I used ostringstream in a lot of function and query in my sw. But the problem arise in thi function only when I substitute an INNER JOIN with thew LEFT JOIN. In fact, if I keep the INNER JOIN instead LEFT JOIN evrthing works as it would.
Using sqlite3_prepare, step_reset an error is thrown during sqlite3_step. I printed the error message that is: "not an error". Is this more helpful? Enrico On Tue, May 26, 2009 at 6:34 PM, Pavel Ivanov <paiva...@gmail.com> wrote: > Instead of > > exe_query(query.str()); > > try to do this: > > size_t len = query.pcount(); > exe_query(string(query.str(), len).c_str()); > > Stringstream never puts 0 byte at the end of the string. > > Pavel > > On Tue, May 26, 2009 at 12:12 PM, Enrico Piccinini > <enrico.piccin...@gmail.com> wrote: > > Hy to all, I'm very new to database and sqlite. > > > > I'm writing a C++ code to execute some queries. > > > > A query of mine does a select with some inner join and a left join as > > reported here: > > //inline int getFunctList(const string& testName, vector<string>& result, > > int& nCol, int& nRow) > > //{ > > > > [...] > > ostringstream query; > > // query << "SELECT > > functs_tbl.Description,resources_tbl.Name,functs_tbl.FunctionalString > FROM > > seq.test_list_tbl " > > // "INNER JOIN seq.functs_tbl on functs_tbl.FN_ID=test_tbl.FN_ID " > > // "INNER JOIN seq.test_tbl on test_tbl.TL_ID=test_list_tbl.TL_ID > " > > // "LEFT JOIN conf.resources_tbl ON > > resources_tbl.RS_ID=functs_tbl.RS_ID " > > // "WHERE test_list_tbl.Name=\"" << testName << "\";" << ends; > > //exe_query(query.str()); > > [...] > > //} > > > > "exe_quey" is a simple wrapper of sqlite3_get_table. > > > > The execution of this line code makes may program to crash. > > > > The same query with the same parameter (testName) executed from tcl > command > > line works perfectly. > > > > I've also tried to execute this query with sqlite3_prepare, step_reset, > but > > the problem is staing on. > > > > I hope that some one can give me some advice because about the solution > of > > the problem. > > > > Thank you in advance. > > Enrico > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users