From: Warren Young Date: June 15 2009 4:34pm Subject: Re: Confused about Blobs and SSQLS ... List-Archive: http://lists.mysql.com/plusplus/8636 Message-Id: <4A367812.8020501@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dan Cook wrote: > Note the BINARY(8) field can be NULL. What happens if you ignore that detail for now? KISS. > testDB.binary_data.data.assign(data_str.c_str(), data_str.length()); > testDB.binary_data.is_null = false; This is more elegantly -- and perhaps correctly -- expressed: testDB.binary_data = sql_blob(dataChar, sizeof(dataChar)); The intermediate std::string isn't of any use. Further, assigning a value to Null always resets the is_null flag, because of course it no longer is null. Notice that this will work whether binary_data is Null<>-wrapped or not. Null<> tries to be fairly transparent. It doesn't really succeed, but where possible...