Postgres CreateBlobStream Issue
Posted: 15.07.2008, 16:32
Hi there,
Recently upgraded from v 6.1.5 to 6.6.2 (mainly for the fixes of memory problems) and I'm generally happy. But now walked into an issue with BLOBs;
We use Delphi 6 with Postgres 8 with code that looks like this:
I captured the generated SQL with ZSQLMonitor:
INSERT INTO mytable (mail_id,att_name,att_file) VALUES (11,'C:/image.jpg',ÿØÿà
which obviously gives a SQL error: syntax error at end of input at
character ....
This used to work with zeos 6.1.5
I tried a couple of different things: using TZquery instead of TZTable, etc, but to no avail....
Anything to do with db encoding maybe?
Hope somebody can help me out.
Recently upgraded from v 6.1.5 to 6.6.2 (mainly for the fixes of memory problems) and I'm generally happy. But now walked into an issue with BLOBs;
We use Delphi 6 with Postgres 8 with code that looks like this:
Code: Select all
Stream2 := TMemoryStream.Create;
Stream2.LoadFromFile(sFile);
ZTable1.Open;
ZTable1.First;
ZTable1.Append;
ZTable1.FieldByName('att_name').AsString := sFile;
Stream1:=ZTable1.CreateBlobStream(zTable1.FieldByName('att_file'), bmWrite );
stream1.Seek(0,soFromBeginning);
fstream := TFileStream.Create(sFile, fmShareDenyNone);
Stream1.CopyFrom( fStream, fStream.size);
stream1.free;
fstream.free;
ZTable1.Post;
INSERT INTO mytable (mail_id,att_name,att_file) VALUES (11,'C:/image.jpg',ÿØÿà
which obviously gives a SQL error: syntax error at end of input at
character ....
This used to work with zeos 6.1.5
I tried a couple of different things: using TZquery instead of TZTable, etc, but to no avail....
Anything to do with db encoding maybe?
Hope somebody can help me out.