You are not logged in.
Hi,
I didin't find how to read TByteDynArray Field from a TSQLHttpClientWinHTTP.list() result.
TRHhisto = class(TSQLRecord)
private
fHisBuffer : TRawUTF8DynArray;
fHisMois : TByteDynArray;
public
procedure Clear; override;
published
property hisBuffer : TRawUTF8DynArray read fHisBuffer write fHisBuffer;
property hisMois : TByteDynArray read fHisMois write fHisMois;
end;
{...}
var Table : TSQLTableJSON;
bl : TSQLRawBlob;
{...}
Table := Client.List([TRHhisto], 'rowID, HISPERID, HISMOIS', StringToUTF8(sWhere));
if Table <> nil then
begin
{...}
bl := Table.getBlob(idx, Table.fieldIndex('HISMOIS'));
------> How to convert bl to a TByteDynArray variable ?
end;
Thanks in advance.
Offline
I've done it first with table.GetBytes but I have don't find how to load the TByteDynArray variable with it.
Do you have a sample. I dont find anything in the documentation and in the forum.
Thanks.
Offline
In fact, TBytes = TByteDynArray = array of byte.
So you can safely trans-type TBytes(aByteDynArrayVariable) and TByteDynArray(aBytesVariable) values directly.
In your case:
aByteDynArrayVariable := TByteDynArray(Table.GetBytes(...))
Note: I answered to your private mail.
Online
Thanks a lot.
Offline
Hi
when i use TByteDynArray(Table.GetBytes(...)) the result contains more bytes (7) than the stored array (perhaps Base64Encode ?).
With TByteDynArray(Table.GetBytes(...)) --> (1,0,12,15,18,48,54,1,2,3,4,5,6,7,8,9,10,11,12)
With client.Retrieve(row, MySQLrecord) --> (1,2,3,4,5,6,7,8,9,10,11,12)
But if i use MySQLRecord.FillFrom(Table) all is fine.
It's good for me.
Offline