Fabio Spadaro <fabiolinos...@gmail.com> wrote:
> 2010/9/9 Igor Tandetnik <itandet...@mvps.org>
> 
>> Fabio Spadaro <fabiolinos...@gmail.com> wrote:
>>> Can you determine  in the blob's data
>>> what is buffered file type and what was its original length?
>> 
>> You retrieve the size of the BLOB field with sqlite3_column_bytes function,
>> or with length() function in SQL.
> 
> I use DB-API 2.0 interface for SQLite databases for python  and seems that
> there is not a function
> equivalent or wrong?

A quick glance at the documentation indeed suggests that there's no way to 
obtain the length of the BLOB without completely reading the BLOB itself. A 
.fetchone() method would give you a tuple with column values, including BLOBs, 
and you can use Python's built-in len() function to determine the length of the 
BLOB.

If this is undesirable, e.g. for performance reasons, you can run a query like 
this: select length(MyBlobColumn); 
-- 
Igor Tandetnik


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to