ZEOS XML data type. lazarus / 63-Database ---------------------------------------------------------------------- Eugeniusz Rink ยท 2020-08-12 21:28 Hi. We have a problem writing XML to a file. We are using PostgreSQL v.12.x. There is a field in the table: ezlecenie_xml type: xml. We use Windows10 x64, Lazarus 2.0.10 x32, ZEOS 7.2.6-stable. So far, the notation as below worked if the data field in the PostgreSQL table had type: bytea. If the field in the table is xml type, the file.xml file is empty. What are we doing wrong? Code: procedure TForm1.Button1Click(Sender: TObject); var blob,myFileStream:TStream; ZapiszPlik:string; begin ZapiszPlik:= 'c:\test\file.xml'; blob := DM.ZQZlecenia.CreateBlobStream(DM.ZQZlecenia.FieldByName('ezle cenie_xml'), bmRead); try blob.Seek(0, soFromBeginning); myFileStream := TFileStream.Create(ZapiszPlik, fmCreate); try myFileStream.CopyFrom(blob, blob.Size) ; finally myFileStream.Free ; end; finally blob.Free ; end; end;