| 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 type | Brad Hubbard | 3 Dec |
| • Re: Problem with Null string type | Warren Young | 3 Dec |
| • Re: Problem with Null string type | Brad Hubbard | 3 Dec |
| • Re: Problem with Null string type | Warren Young | 3 Dec |
| • Re: Problem with Null string type | Brad Hubbard | 4 Dec |
| • Re: Problem with Null string type | Brad Hubbard | 4 Dec |
| • Re: Problem with Null string type | Warren Young | 4 Dec |
| • Re: Problem with Null string type | Brad Hubbard | 5 Dec |
| • Re: Problem with Null string type | Warren Young | 5 Dec |
| • Re: Problem with Null string type | Brad Hubbard | 6 Dec |
| • Re: Problem with Null string type | Warren Young | 6 Dec |
| • Re: Problem with Null string type | Brad Hubbard | 6 Dec |
| • execute failed | bsingh | 8 Dec |
| • Re: execute failed | Warren Young | 8 Dec |
