Save/Load one record to and from UniQuery

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kneighbour
Posts: 77
Joined: Wed 08 Oct 2008 04:55

Save/Load one record to and from UniQuery

Post by kneighbour » Thu 23 Apr 2015 04:36

I am trying to setup a Synchronization system for a specific table in my Firebird database. What I want to do is store the master records in a central database. Then all the clients login and the master data is downloaded to each client. The are a few issues with dates and so forth, but that is the main concept.

I can upload the master records to the central database ok using XML and streams. ie

Code: Select all

   procedure AddMySQL;
   var
      BStream: TStream;
   begin
       qryDest.insert;
       qryDest.FieldByName('DATE_UPDATED').AsDateTime := Now;
       BStream := qryDest.CreateBlobStream(qryDest.FieldByName('DATA'), bmWrite);
      try
         qrySource.SaveToXML(BStream);
      finally
         BStream.Free;
      end;
      qryDest.post;
   end;
This works fine and the complete current record from the Source UniQuery is stored as XML in one field of the Dest table.

the question is - how do I get the XML back, convert it to the appropriate fields and add it to the Source table?

There does not seem to be a Method in UniQuery to do this. ie query.LoadFromXML(stream)

Please note - I do not want to load the whole table - just the one record.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Save/Load one record to and from UniQuery

Post by ViktorV » Thu 23 Apr 2015 11:40

Unfortunately, at the moment, UniDAC does not support this functionality.
Therefore you should implement parsing of XML data in the client application by yourself.

Post Reply