"aditya siram" <
[hidden email]>
wrote in message
news:
[hidden email]
> How do I insert an image file into sqlite table? Can I just use a
> path-specifier? For instance,
> create table ("name" varchar, "data" blob);
> insert into table ("someBlob", "./blob.jpg");
No, SQLite won't read the file for you. You will have to read the data
into memory yourself, then insert it into the table (you could possibly
use memory-mapped files - see CreateFileMapping on Windows, mmap on
Linux). The easiest way is perhaps to use a parameterized query - see
sqlite3_bind_blob.
Alternatively, you could use incremental BLOB API
(
http://sqlite.org/c3ref/blob_open.html). Useful for large files, as you
don't need to have all the data in memory at once.
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users