Bob Perkins 0 Posted October 23, 2023 I'm using an MS SQL database to store large files in a table. The files are too large for binding to a field directly. It has to go through a command just like the update to get it into the database. No exception is raised but the function returns false. I am finding it difficult to find an answer with Google search. Any help would be apprciated. RIMSDBFireDac.StartTransaction; try with DCaseAttach do begin FireDacQuery.SQL.Text := 'SELECT :p = ''D:\TEMP\TEMP.MP4'' FROM caseattach WHERE id = :id'; FireDacQuery.Params[0].DataType := ftStream; FireDacQuery.Params[0].FDDataType := dtHBFile; FireDacQuery.Params[0].ParamType := ptOutput; FireDacQuery.Params[0].StreamMode := smOpenRead; FireDacQuery.Params[1].AsInteger := CaseN; if FireDacQuery.OpenOrExecute then FireDacQuery.Params[0].AsStream.Read(Buffer, AttachSize) else ErrorMsg('OpenOrExecute failed.'); end; RIMSDBFireDac.Commit; except on E: Exception do begin ErrorMsg('<PullImageFromDB on pulling photo> ' + E.Message); RIMSDBFireDac.Rollback; end; end; Share this post Link to post
Dmitry Arefiev 101 Posted October 26, 2023 https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Support_for_Blob_Streaming_in_FireDAC#SQL_Server_FILESTREAM https://learn.microsoft.com/en-us/sql/relational-databases/system-functions/pathname-transact-sql?view=sql-server-ver16#return-value Share this post Link to post