From: Warren Young Date: January 11 2008 5:01am Subject: Re: query.str() not returning anything List-Archive: http://lists.mysql.com/plusplus/7385 Message-Id: <4786F82C.6020802@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Kemin Zhou wrote: > Has anyone seen this problem? > > Query query=connection.query(); > query << "some sql string"; > try { query.execute(); } catch (exception &err) > { > > cerr << query.str() << endl << err.what() << endl; Are you using a v3.0 beta, or the current svn version? If so, you're running afoul of the new auto-reset logic. In MySQL++ v2, it was necessary to call Query.reset() much more often. v3 detects many cases where it can do it for you. It was a little over-aggressive, though, resetting the query object even when the query execution didn't succeed, making it hard to print info to help you debug the problem. I've changed it so the current svn version now only resets when the query succeeds. By the way, v3 now supports this syntax for showing the contents of the query string, when you aren't using template queries: cerr << query << endl;