List:MySQL++« Previous MessageNext Message »
From:Jim Wallace Date:January 28 2009 1:02pm
Subject:RE: Question about BadQuery
View as plain text  
I do that exact same thing elsewhere and was thinking the about doing it
in for the query to avoid getting my MySQL++ code out-of-sync.  However,
it does require the extra str() and quite a bit of code changes to do
that.  I'm going to look at when BadQuery is thrown and if it's easy to
put in the completed query I'll do that.

Thanks.

-----Original Message-----
From: Warren Young [mailto:mysqlpp@stripped] 
Sent: Tuesday, January 27, 2009 11:45 PM
To: Jim Wallace
Subject: Re: Question about BadQuery

Jim Wallace wrote:
> if I have multiple statements in a try/catch I could figure out
> which one caused the exception.

A way you could get by without it:

string last_query;
try {
	Query q("stuff");
	last_query = q.str();
	StoreQueryResult res = q.store();
	// do something with res

	q = "other stuff";
	last_query = q.str();
	res = q.store();
	// do more stuff

	...
}
catch (const BadQuery& e) {
	cerr << "Query failed: \"" << last_query << "\"" << endl;
}

Thread
RELEASE: v3.0.5Warren Young7 Aug
  • query.str() in template query -- help!Jim Wallace28 Jan
    • RE: query.str() in template query -- <blush>Jim Wallace28 Jan
      • Re: query.str() in template query -- <blush>Warren Young28 Jan
        • storein with parametersJim Wallace28 Jan
          • Re: storein with parametersWarren Young28 Jan
            • RE: storein with parametersJim Wallace28 Jan
              • Re: storein with parametersWarren Young28 Jan
            • Question about BadQueryJim Wallace28 Jan
              • Re: Question about BadQueryWarren Young28 Jan
RE: RELEASE: v3.0.5Bernard8 Aug
  • Re: RELEASE: v3.0.5Warren Young8 Aug
    • Re: RELEASE: v3.0.5Alex9 Aug
RE: Question about BadQueryJim Wallace28 Jan
RE: Question about BadQueryDale Stewart28 Jan
RE: Question about BadQueryDale Stewart28 Jan
  • Re: Question about BadQueryWarren Young28 Jan