From: Warren Young Date: March 20 2009 5:09am Subject: Re: checking NULL List-Archive: http://lists.mysql.com/plusplus/8492 Message-Id: MIME-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Mar 19, 2009, at 10:50 PM, Jithin Emmanuel wrote: > name = row["name"].get_string(); First, you really should consider upgrading to MySQL++ v3. You're clearly still on 2.3 or earlier. There have been probably half a dozen changes to the way we handle SQL nulls in v3.0.0 and later, some of them highly useful. Second, my previous reply didn't say to convert the return value of Row::operator[]() to a std::string and then make the test. I said to test the return value of Row::operator[]() directly. Why? Because there's nothing like SQL null in C or C++. When you convert SQL data to a non-SQL data type, you lose the SQL null flag. You must test for the flag before you make the conversion.