Hi All,
There is a database that I created using Postgresql, in this database;
I have a blob column that I have defined, in this column I intend to store binary data to files.
Using opendialog, I transfer the file I selected to MemoryStream, then the SQL query is set to the parameter value.
var
fc,fof:TMemoryStream;
....
DataModule1.ZQuery_CRecord.SQL.Clear;
DataModule1.ZQuery_CRecord.SQL.Add(
' UPDATE '+ table_name+ ' SET '+
' DOC '+
'=:DOC WHERE ID=:ID;'
);
DataModule1.ZQuery_CRecord.Params.ParamByName('ID').AsString:=DataModule1.ZQuery_VZ.FieldByName('id').AsString;
DataModule1.ZQuery_CRecord.Params.ParamByName('DOC').LoadFromStream(fc,ftBlob);
DataModule1.ZQuery_CRecord.ExecSQL;
I transfer it in the form and save it in the relevant database. No problem, I'm coming here.
But by making a change; This process is not with the sql query, but directly in the field of the sql query;
I want to transfer the memory stream to the
ZQuery.FieldByName('DOC').AsBCD:=how to use fc;
feature, is it possible?
I would be very grateful if you could help. Regards.