Closed algalg closed 2 years ago
I use this on MSSQL Server. Unfortunately I don't think there is any way to tell that the select query is for updating the content. This odd construction is what MS documents as way of working with large data https://docs.microsoft.com/en-us/sql/connect/oledb/ole-db-how-to/set-large-data-ole-db?view=sql-server-ver15
This is how it is used in the code:
objectid := '123';
FileName := 'C:\TheBigContentFile.pdf';
FileStrm := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone);
try
FProviderSession.ExecuteNoResult('INSERT INTO CONTENT_TABLE (id, blobfiled) ', [objectid, 'NULL']);
Stmt := Connection.NewStatementPrepared('SELECT blobfiled FROM CONTENT_TABLE WHERE id = ?', true, true);
Stmt.ForceBlobAsNull := false;
Stmt.Bind([ObjectID]);
Stmt.ExecutePrepared(true);
SQLDBRows := Stmt;
SQLDBRows.Step();
SQLDBRows.ColumnBlobFromStream(0, FileStrm);
finally
FileStrm.Free;
end;
No other proposal after a few months waiting for an alternative.
Please reopen if needed.
Implementation of ColumnBlobToStream and ColumnBlobFromStream in TOleDBStatement Implementation of TransactionIsolationLevel property in TOleDBConnectionProperties