SQLite Forum

length function for BLOB out of sync with documentation
Login
My data is binary data, not characters, and I had set the column type to BLOB. It only happened to contain some valid UTF-8 sequences. When I now look at the column's values with typeof(), I indeed get TEXT as the type. 

Therefore the problem lies in the INSERT/UPDATE ops. I.e. you are right; the length() function works correctly. I made bad assumptions.

So my real problem is inserting/updating data and ensuring it's processed as a BLOB. I access the db through ODBC, since its used by different programs (python3+pyodbc and a set of C functions which use the unixodbc driver). I would prefer to use SQL to do the INSERTs and UPDATEs, but it is not out of the question to tweak the ODBC commands (SQLPutData et al). If I write a function which makes sure that the ODBC driver gets the data as long data (BLOB), will sqlite3 then understand it to be of type BLOB? Or is there some other tip you could give me? Of course it all depends on how libsqliteodbc and unixodbc handle BLOBs.

I totally get this question is now getting a bit out of hand. I Greatly appreciate the help.