List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:March 19 2008 11:58am
Subject:Re: Problem Handling Null Values
View as plain text  
Dustin Moore wrote:
> On Tue, 2008-03-18 at 01:18 -0600, Warren Young wrote:
>> 1. if (!result.at(0)["Unit_id"].is_null()) ...
> 
> I don't really understand why I can't get the others to work

StoreQueryResult::operator[] returns Row&.  Row::operator[] returns 
const String&.  String has member is_null() today, but until the next 
version of MySQL++, doesn't have operator==(mysqlpp::null_type), the 
type of mysqlpp::null.  Thus, it can't be tested as null in this way.

(at() is the same as operator[]() in StoreQueryResult and Row, so you 
can substitute it in above where you like.)
Thread
Problem Handling Null ValuesDustin Moore17 Mar
  • Re: Problem Handling Null ValuesWarren Young17 Mar
  • Re: Problem Handling Null ValuesWarren Young17 Mar
    • Re: Problem Handling Null ValuesDustin Moore18 Mar
      • Re: Problem Handling Null ValuesWarren Young18 Mar
        • Re: Problem Handling Null ValuesDustin Moore19 Mar
          • Re: Problem Handling Null ValuesWarren Young19 Mar