TMSQuery to/from Binary & JSON
Posted: Fri 06 May 2016 01:50
Hi,
We currently use the following method to turn MSSQL returned data into binary for transmission through RemObjects. Is it possible to get raw data into binary from MSSQL faster than this method?
Would it be possible to build in a saveToBinaryStream/loadFromBinaryStream method directly into TMSQuery?
Also a saveToJSON would be very good as well, using the fastest JSON library available.
var
query: TMSQuery;
VirtualTable: TVirtualTable;
begin
query := db.CreateMSQuery( ); //returns TMSQuery
query.SQL.Text := 'select * from [table]';
query.open;
result := binary.create;
VirtualTable := TVirtualTable.Create(nil);
VirtualTable.Assign(query);
VirtualTable.saveToStream( result );
VirtualTable.free;
query.free;
end;
We currently use the following method to turn MSSQL returned data into binary for transmission through RemObjects. Is it possible to get raw data into binary from MSSQL faster than this method?
Would it be possible to build in a saveToBinaryStream/loadFromBinaryStream method directly into TMSQuery?
Also a saveToJSON would be very good as well, using the fastest JSON library available.
var
query: TMSQuery;
VirtualTable: TVirtualTable;
begin
query := db.CreateMSQuery( ); //returns TMSQuery
query.SQL.Text := 'select * from [table]';
query.open;
result := binary.create;
VirtualTable := TVirtualTable.Create(nil);
VirtualTable.Assign(query);
VirtualTable.saveToStream( result );
VirtualTable.free;
query.free;
end;