List:MySQL++« Previous MessageNext Message »
From:Brad Hubbard Date:December 5 2008 9:19am
Subject:Re: Problem with Null string type
View as plain text  
I think this became a little more complicated than I intended somehow.

If I want to display the data in it->mobileNumber is the preferred 
method to do it like this?

if( it->mobileNumber == mysqlpp::null )
{
  something_that_requires_a_c_string = "";
}
else
{
  something_that_requires_a_c_string = it->mobileNumber.data.c_str(); // 
or it->mobileNumber.data
}

Basically, there just isn't an example that shows specifically how to do 
this and I can't find any code on the web that shows this either, not 
saying it isn't there, just saying I haven't been able to find it.

The only example using char based data does this;

            if (it->description != mysqlpp::null) {
                cout << " (" << it->description << ")";

but I presume it can do that because of an overloaded "<<" operator?

I really just want to access the string in the recommended fashion.

I appreciate you "hanging in there" on this one Warren.

Kind regards,
Brad

Thread
Problem with Null string typeBrad Hubbard3 Dec
  • Re: Problem with Null string typeWarren Young3 Dec
    • Re: Problem with Null string typeBrad Hubbard3 Dec
      • Re: Problem with Null string typeWarren Young3 Dec
        • Re: Problem with Null string typeBrad Hubbard4 Dec
          • Re: Problem with Null string typeBrad Hubbard4 Dec
          • Re: Problem with Null string typeWarren Young4 Dec
            • Re: Problem with Null string typeBrad Hubbard5 Dec
              • Re: Problem with Null string typeWarren Young5 Dec
                • Re: Problem with Null string typeBrad Hubbard6 Dec
Re: Problem with Null string typeWarren Young6 Dec
  • Re: Problem with Null string typeBrad Hubbard6 Dec
    • execute failedbsingh8 Dec
      • Re: execute failedWarren Young8 Dec