Lots of good replies. My problem is solved, thank you. My assumption was that GetBytes() could be used to read the bytes of any column regardless of type. What difference should column type or affinity make if I'm asking for bytes? If I'm using GetBytes() on a column with REAL affinity, it should put 8 bytes in the read buffer, but it doesn't. If I send text to a BLOB column it's typeof() changes to TEXT which confuses GetBytes(). I think this is pretty silly because bytes are bytes, right? Why bother verifying type when the method name already tells you what you are getting and bytes can be obtained from any data type? (Rhetorical questions, but feel free to respond anyway.)
Anyway, the problem is solved. Thank you all. ( cast('x y z' as blob) ) is especially convenient. Thank you for that excellent suggestion, Jean (and thanks for the Stack Overflow link, that helped too). And thanks to R. Smith for posting the informative examples that also helped me understand what was happening. -- Bill Drago Staff Engineer L3 Narda-MITEQ 435 Moreland Road Hauppauge, NY 11788 631-272-5947 / William.Drago at L-3COM.com > -----Original Message----- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite- > users-bounces at mailinglists.sqlite.org] On Behalf Of Jean Chevalier > Sent: Thursday, July 02, 2015 1:40 PM > To: sqlite-users at mailinglists.sqlite.org > Subject: Re: [sqlite] Reader.GetBytes() - when is a byte not a byte? > > It's not mandatory to use x'<hex>' notation to insert into a blob, when > one can use cast. > > The following should return blob content correctly without explicitly > lying it down as Hex: > > sqlite> create table T (c blob check(typeof(c) = 'blob')); > > sqlite> insert into T values ( cast('x y z' as blob) ); > > sqlite> select c from T; > > x y z > > Please check whether your calling program consumes the above as text or > blob, I'd expect blob. > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments.