Opening Blob Data stored in Sqlite as a File with Tcl/Tk
- by dmullins
I am using the following tcl code to store a file from my deskstop into a Sqlite database as blob data ($fileText is a path to a text file):
sqlite3 db Docs.db
set fileID [open $fileText RDONLY]
fconfigure $fileID -translation binary
set content [read $fileID]
close $fileID
db eval {insert into Document (Doc) VALUES ($content)}
db close
I have…