Hello,
I have to report an issue with blob parameters serialization in DataTables. I sometimes use DataTable parameter as a channel for a serialized TDAMemDataTable (an extra data returned together with an Exported DataTable). Using blob (variant array of byte) parameters was not working properly, so I utilized the AnsiString parameter capabilities. Unfortunately as those were removed, there is currently no other way. I have hotfixed the issue with blob parameters and it seems to be working.
Here is the patch (the stream is binary compatible with previous DA versions):
uDABin2DataStreamer.pas, function TDABin2DataStreamer.WriteParam, lines 960-961:
Bin2_WriteAnsistringToStream(Data, 'Value');
+++ if AParam.DataType = datBlob then
+++ Bin2_BlobToStreamAsStr(Data, AParam.Value)
+++ else
Bin2_WriteVariantAsUTF8stringToStream(Data, AParam.Value);
uDABin2DataStreamer.pas, function TDABin2DataStreamer.ReadParam, lines 984-986
else if sName = 'Size' then AParam.Size := StrToInt(sValue)
--- else if sName = 'Value' then AParam.Value := Bin2_ReadVariantasUTF8stringFromStream(Data);
+++ else if sName = 'Value' then begin
+++ if AParam.DataType = datBlob then
+++ AParam.Value:= Bin2_ReadBlobFromStream(Data)
+++ else
+++ AParam.Value := Bin2_ReadVariantasUTF8stringFromStream(Data);
+++ end
else ;
Regards from Prague,
Jaroslav