Loading and Retrieving a large Text Blob in Firebird lazarus / 16-Databases ---------------------------------------------------------------------- cov · 2013-06-15 14:32 I have a large Text File which I want to load, line-by-line into a Firebird SUB_TYPE 1 BLOB. The following should work, but some of the lines may not be relevant and some of the lines will be blank. Code: [Select]SQLQuery1.SQL.Text:= 'insert into ODTABLE (Content) values (:Content)'; SQLQuery1.ParamByName('Content').LoadFromFile(TextFileName, ftBlob); Also, how do I extract the Content once it is loaded into the Database? ---------------------------------------------------------------------- goodname · 2013-06-16 14:52 Looks like you need the get familiar with file streams. Have not used file streams so don't really know the function names to use. Saving to database var strm: TmemoryStream; //load file to stream. //edit stream. SQLQuery1.SQL.Text:= 'insert into ODTABLE (Content) values (:Content)'; SQLQuery1.Params[0].LoadFromStream(strm,ftBlob); Reading from database var strm: Tstream; SQLQuery1.SQL.Text:='SELECT content FROM ODTABLE WHERE id=1;'; strm:=SQLQuery1.CreateBlobStream(SQLQuery1.Fields[0],bmRead);