List:MySQL++« Previous MessageNext Message »
From:Steven Van Ingelgem Date:December 19 2009 10:27am
Subject:Re: How can I detect a query is wrong?
View as plain text  
*Consider this code:*
  bool has1field = true;
  Query qry = conn.query("SELECT field FROM table");
  UseQueryResult res;
  res = qry.use();

  if ( !res )
  {
    has1field = false;
    qry = conn.query("SELECT field1, field2 FROM table");
    res = qry.use();
  }

In this case the 2nd res is still not valid, because somehow it will
re-execute the 1st query? As the error reads "unknown field 'field'"...

The problem is that the ostream seems not to be overwritten... I think you
should do ostream::operator=(rhs); in the beginning of this function.


Grtz,
Steven


2009/12/19 Steven Van Ingelgem <steven@stripped>

> I RTFM ;). And I just copied my piece of code.
> After your mail I saw though I am using v3.0.1 of your code, and upgraded
> now to 3.0.9... Fixing the issue :)!!
>
>
> Thx
>
>
>
>
> 2009/12/19 Warren Young <mysqlpp@stripped>
>
> On 12/18/2009 4:13 PM, Steven Van Ingelgem wrote:
>>
>>>   Connection conn(false);
>>>
>>
>> [snip]
>>
>>
>>    ... Neither .use() nor .store() throws an exception or tells me
>>> something
>>> went wrong in there...
>>>
>>
>> ...because you passed false to the Connection ctor.  RTFM. :)
>>
>> --
>> MySQL++ Mailing List
>> For list archives: http://lists.mysql.com/plusplus
>> To unsubscribe:
>> http://lists.mysql.com/plusplus?unsub=1
>>
>>
>

Thread
How can I detect a query is wrong?Steven Van Ingelgem19 Dec
  • Re: How can I detect a query is wrong?Warren Young19 Dec
    • Re: How can I detect a query is wrong?Steven Van Ingelgem19 Dec
      • Re: How can I detect a query is wrong?Steven Van Ingelgem19 Dec
        • Re: How can I detect a query is wrong?Warren Young19 Dec
          • Re: How can I detect a query is wrong?Steven Van Ingelgem19 Dec
            • Re: How can I detect a query is wrong?Steven Van Ingelgem19 Dec
            • Re: How can I detect a query is wrong?Warren Young22 Dec
              • Re: How can I detect a query is wrong?Steven Van Ingelgem22 Dec
                • Re: How can I detect a query is wrong?Warren Young22 Dec
Re: How can I detect a query is wrong?Warren Young23 Dec
  • Re: How can I detect a query is wrong?Steven Van Ingelgem23 Dec
    • Re: How can I detect a query is wrong?Warren Young23 Dec
      • Re: How can I detect a query is wrong?Steven Van Ingelgem23 Dec
        • Re: How can I detect a query is wrong?Warren Young23 Dec