Andy Ross <[EMAIL PROTECTED]> wrote: > > Problem is, the *blob* value of "testval" does not, apparently, equal > the *text* value of "testval" in the database. >
There is good reason for this, actually. TEXT values can sort in many different orders, depending on what collating sequence is used. Different languages use different collating sequences. Some languages have multiple collating sequences. I'm told, for example, that there are two common ways to short Chinese and several other less common ways. The database needs to be able to handle all of these. But BLOBs always sort in memcmp() order. The second point is that TEXT can be converted from UTF-8, UTF-16be, and UTF-16le. So, for example, if the a user stores a UTF-16le string on an x86 machine, the moves the database file over to a ppc machine and reads out the same string, it comes out as UTF-16be. Or if one user writes a UTF-8 string and another requests a UTF-16 string, the conversion is automatic. But with a BLOB, no conversions ever occur. Because TEXT does not have a uniform representation, and because the sort order can be different for each column, it is difficult to know how to compart TEXT and BLOBs. So SQLite takes the approach of always making every BLOB larger than every TEXT string. That is simple and unambiguous. -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------